X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=0334fd0229b6a4d3c8fad1512a0536e09407170b;hb=d26ed189093987978190ee07f485a4840746c13c;hp=ce48f12407e82e03ab1b1fb29f6d3c8f4ad03e9a;hpb=b78e8ac7987fbf35a4ba60534c4a3d2b290562b9;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index ce48f124..0334fd02 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -297,6 +297,9 @@ MWindow::~MWindow() #endif reset_caches(); dead_plugins->remove_all_objects(); +// must delete theme before destroying plugindb +// theme destructor will be deleted by delete_plugins + delete theme; theme = 0; delete_plugins(); finit_error(); keyframe_threads->remove_all_objects(); @@ -325,7 +328,6 @@ MWindow::~MWindow() delete defaults; defaults = 0; delete assets; assets = 0; delete splash_window; splash_window = 0; -// delete theme; theme = 0; // deleted by delete_plugins if( !edl->Garbage::remove_user() ) edl = 0; delete channeldb_buz; delete channeldb_v4l2jpeg; @@ -733,14 +735,14 @@ void MWindow::add_plugins(ArrayList &plugins) plugins.remove_all(); } -void MWindow::init_plugin_tips(ArrayList &plugins) +void MWindow::init_plugin_tips(ArrayList &plugins, const char *lang) { const char *cfg_path = File::get_cindat_path(); char msg_path[BCTEXTLEN]; int txt = 0; FILE *fp = 0; if( BC_Resources::language[0] ) { snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.%s", - cfg_path, BC_Resources::language); + cfg_path, lang); fp = fopen(msg_path, "r"); } if( !fp ) { @@ -1022,12 +1024,13 @@ void MWindow::init_theme() fprintf(stderr, _("MWindow::init_theme: prefered theme %s not found.\n"), preferences->theme); - if( !theme_plugin && strcasecmp(preferences->theme, DEFAULT_THEME) ) { + const char *default_theme = _(DEFAULT_THEME); + if( !theme_plugin && strcasecmp(preferences->theme, default_theme) ) { fprintf(stderr, _("MWindow::init_theme: trying default theme %s\n"), - DEFAULT_THEME); + default_theme); for(int i = 0; i < plugindb->total && !theme_plugin; i++) { if( plugindb->get(i)->theme && - !strcasecmp(DEFAULT_THEME, plugindb->get(i)->title) ) + !strcasecmp(default_theme, plugindb->get(i)->title) ) theme_plugin = plugindb->get(i); } } @@ -1801,10 +1804,6 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); show_plugin(plugin); } } - else - { - plugin->show = 0; - } plugin = (Plugin*)plugin->next; } @@ -2010,7 +2009,7 @@ void MWindow::create_objects(int want_gui, if(debug) PRINT_TRACE init_ladspa_plugins(this, preferences); if(debug) PRINT_TRACE - init_plugin_tips(*plugindb); + init_plugin_tips(*plugindb, cin_lang); if(splash_window) splash_window->operation->update(_("Initializing GUI")); if(debug) PRINT_TRACE @@ -2951,7 +2950,7 @@ void MWindow::update_project(int load_mode) const int debug = 0; if(debug) PRINT_TRACE - restart_brender(); + init_brender(); edl->tracks->update_y_pixels(theme); if(debug) PRINT_TRACE @@ -3616,7 +3615,8 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int result = file->open_file(preferences, asset, 1, 0); if( !result && delete_tracks > 0 ) undo->update_undo_before(); - if( !result && asset->video_data && asset->get_video_layers() > 0 ) { + int video_layers = asset->get_video_layers(); + if( !result && asset->video_data && vstream < video_layers ) { // try to get asset up to date, may fail file->select_video_stream(asset, vstream); // either way use what was/is there. @@ -3672,7 +3672,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra if( !result && asset->audio_data && asset->channels > 0 ) { session->sample_rate = asset->get_sample_rate(); int64_t channel_mask = 0; - int astrm = !asset->video_data ? -1 : + int astrm = !asset->video_data || vstream >= video_layers ? -1 : file->get_audio_for_video(vstream, astream, channel_mask); if( astrm >= 0 ) file->select_audio_stream(asset, astrm); if( astrm < 0 || !channel_mask ) channel_mask = (1<channels)-1;