From 2e48b660e37eb5c661264d601211e16cb6cd6e89 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 25 Oct 2018 09:18:03 -0600 Subject: [PATCH] repair default keyframe load, tweak init default histogram threshold --- cinelerra-5.1/cinelerra/pluginclient.C | 12 ++++++++---- cinelerra-5.1/plugins/histogram/histogramconfig.C | 2 +- .../plugins/histogram_bezier/bistogramconfig.C | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cinelerra-5.1/cinelerra/pluginclient.C b/cinelerra-5.1/cinelerra/pluginclient.C index f1fe25b9..7f1fdd04 100644 --- a/cinelerra-5.1/cinelerra/pluginclient.C +++ b/cinelerra-5.1/cinelerra/pluginclient.C @@ -30,6 +30,7 @@ #include "edlsession.h" #include "file.h" #include "filesystem.h" +#include "filexml.h" #include "indexable.h" #include "language.h" #include "localsession.h" @@ -557,9 +558,12 @@ void PluginClient::load_defaults_xml() int data_size = fread(data, 1, sz, fp); if( data_size < 0 ) data_size = 0; if( data_size > 0 ) { + data[data_size] = 0; + temp_keyframe.xbuf->oseek(data_size); // Get window extents - int state = 0; - for( int i=0; i<(data_size-8) && data[i]!='<'; ++i ) { + int i = 0; + for( int state=0; i<(data_size-8) && state>=0; ++i ) { + if( !data[i] || data[i] == '<' ) break; if( !isdigit(data[i]) ) continue; if( !state ) { window_x = atoi(data + i); @@ -567,11 +571,11 @@ void PluginClient::load_defaults_xml() } else { window_y = atoi(data + i); - break; + state = -1; } while( iiseek(i); read_data(&temp_keyframe); } diff --git a/cinelerra-5.1/plugins/histogram/histogramconfig.C b/cinelerra-5.1/plugins/histogram/histogramconfig.C index 32da6086..7203063f 100644 --- a/cinelerra-5.1/plugins/histogram/histogramconfig.C +++ b/cinelerra-5.1/plugins/histogram/histogramconfig.C @@ -50,7 +50,7 @@ void HistogramConfig::reset(int do_mode) { automatic = 0; automatic_v = 0; - threshold = 0.1; + threshold = 1.0; } } diff --git a/cinelerra-5.1/plugins/histogram_bezier/bistogramconfig.C b/cinelerra-5.1/plugins/histogram_bezier/bistogramconfig.C index 267f2560..88c4911d 100644 --- a/cinelerra-5.1/plugins/histogram_bezier/bistogramconfig.C +++ b/cinelerra-5.1/plugins/histogram_bezier/bistogramconfig.C @@ -190,7 +190,7 @@ void HistogramConfig::reset(int do_mode) if(do_mode) { automatic = 0; - threshold = 0.1; + threshold = 1.0; split = 0; smoothMode = 0; } -- 2.26.2