repair default keyframe load, tweak init default histogram threshold
authorGood Guy <good1.2guy@gmail.com>
Thu, 25 Oct 2018 15:18:03 +0000 (09:18 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 25 Oct 2018 15:18:03 +0000 (09:18 -0600)
cinelerra-5.1/cinelerra/pluginclient.C
cinelerra-5.1/plugins/histogram/histogramconfig.C
cinelerra-5.1/plugins/histogram_bezier/bistogramconfig.C

index f1fe25b9f9e90581756f5668bc12ca18c104368e..7f1fdd04323959926339ba8bc5ad108803b207ea 100644 (file)
@@ -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( i<data_size && isdigit(data[i]) ) ++i;
                        }
-                       data[data_size] = 0;
+                       temp_keyframe.xbuf->iseek(i);
                        read_data(&temp_keyframe);
                }
 
index 32da60864f24d9c2ab87c9232fa5f9c35a5c18b0..7203063f35298203b611cd8e6034304754243329 100644 (file)
@@ -50,7 +50,7 @@ void HistogramConfig::reset(int do_mode)
        {
                automatic = 0;
                automatic_v = 0;
-               threshold = 0.1;
+               threshold = 1.0;
        }
 }
 
index 267f2560305def98b52b3a6292a471b53e556751..88c4911d9fd2c13de66fcd3f78b493a940addf2f 100644 (file)
@@ -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;
        }