From 5087af31b39efcae59f7bad38708ebf12f53dc12 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Mon, 26 Feb 2018 15:17:56 -0700 Subject: [PATCH] recover lost auto, null attach effect segv, clip picon color_model fix --- cinelerra-5.1/cinelerra/autos.C | 14 ++++++++------ cinelerra-5.1/cinelerra/awindowgui.C | 7 +++++-- cinelerra-5.1/cinelerra/plugindialog.C | 8 +++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cinelerra-5.1/cinelerra/autos.C b/cinelerra-5.1/cinelerra/autos.C index 49a8ea1c..ced07836 100644 --- a/cinelerra-5.1/cinelerra/autos.C +++ b/cinelerra-5.1/cinelerra/autos.C @@ -502,15 +502,17 @@ int Autos::copy(int64_t start, //printf("Autos::copy 10 %d %d %p\n", default_only, start, autoof(start)); if(active_only || (!default_only && !active_only)) { - for(Auto* current = autoof(start); - current && current->position <= end; - current = NEXT) - { + Auto *current = autoof(start); +// need the last one if past the end + if( !current && last ) + last->copy(start, end, file, default_only); + + while( current && current->position <= end ) { // Want to copy single keyframes by putting the cursor on them - if(current->position >= start && current->position <= end) - { + if( current->position >= start && current->position <= end ) { current->copy(start, end, file, default_only); } + current = NEXT; } } // Copy default auto again to make it the active auto on the clipboard diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 094ef19b..796a739e 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -622,20 +622,23 @@ void AssetPicon::create_objects() icon_vframe = VFramePng::vframe_png(clip_icon_path); } if( !icon_vframe ) { +printf("render clip: %s\n", name); int edl_h = edl->get_h(), edl_w = edl->get_w(); int height = edl_h > 0 ? edl_h : 1; int width = edl_w > 0 ? edl_w : 1; + int color_model = edl->session->color_model; pixmap_w = pixmap_h * width / height; if( gui->temp_picon && - (gui->temp_picon->get_w() != width || + (gui->temp_picon->get_color_model() != color_model || + gui->temp_picon->get_w() != width || gui->temp_picon->get_h() != height) ) { delete gui->temp_picon; gui->temp_picon = 0; } if( !gui->temp_picon ) { gui->temp_picon = new VFrame(0, -1, - width, height, BC_RGB888, -1); + width, height, color_model, -1); } char string[BCTEXTLEN]; sprintf(string, _("Rendering %s"), name); diff --git a/cinelerra-5.1/cinelerra/plugindialog.C b/cinelerra-5.1/cinelerra/plugindialog.C index 8b83480b..e4a2cce3 100644 --- a/cinelerra-5.1/cinelerra/plugindialog.C +++ b/cinelerra-5.1/cinelerra/plugindialog.C @@ -266,11 +266,9 @@ void PluginDialog::create_objects() Track *track = mwindow->edl->tracks->number(plugin_locations.values[i]->module); char *track_title = track->title; int number = plugin_locations.values[i]->plugin; - Plugin *plugin = track->get_current_plugin(mwindow->edl->local_session->get_selectionstart(1), - number, - PLAY_FORWARD, - 1, - 0); + double start = mwindow->edl->local_session->get_selectionstart(1); + Plugin *plugin = track->get_current_plugin(start, number, PLAY_FORWARD, 1, 0); + if( !plugin ) continue; char string[BCTEXTLEN]; const char *plugin_title = _(plugin->title); snprintf(string, sizeof(string), "%s: %s", track_title, plugin_title); -- 2.26.2