fix bug in batchrender job load from xml
authorGood Guy <[email protected]>
Thu, 11 Jun 2020 20:18:32 +0000 (14:18 -0600)
committerGood Guy <[email protected]>
Thu, 11 Jun 2020 20:18:32 +0000 (14:18 -0600)
cinelerra-5.1/cinelerra/batchrender.C
cinelerra-5.1/cinelerra/filexml.C
cinelerra-5.1/cinelerra/filexml.h

index 9703361cb8b04167e26dc8e21c7f55a78e808b55..0694cc2fd445fc6232625f33ad13177e47f6b102 100644 (file)
@@ -121,6 +121,8 @@ BatchRenderJob *BatchRenderJob::copy()
 void BatchRenderJob::load(FileXML *file)
 {
        int result = 0;
+       char job_title[BCSTRLEN];
+       strcpy(job_title, file->tag.title);
 
        enabled = file->tag.get_property("ENABLED", enabled);
        farmed = file->tag.get_property("FARMED", farmed);
@@ -138,7 +140,7 @@ void BatchRenderJob::load(FileXML *file)
 // coding maintenance.  The defaults must now be stuffed into the XML for
 // unique storage.
                        BC_Hash defaults;
-                       defaults.load_string(file->read_text());
+                       defaults.load_string(file->read_text(job_title));
                        asset->load_defaults(&defaults,
                                "", 0, 1, 0, 0, 0);
                }
@@ -1196,6 +1198,7 @@ void BatchRenderLoadList::run()
 
        int result2 = filewindow.run_window();
        if( !result2 ) {
+               thread->gui->lock_window("BatchRenderLoadList::run");
                strcpy(thread->batch_path, filewindow.get_submitted_path());
                thread->gui->batch_path->update(thread->batch_path);
                thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path);
@@ -1203,6 +1206,7 @@ void BatchRenderLoadList::run()
                thread->gui->create_list(1);
                thread->current_job = 0;
                thread->gui->change_job();
+               thread->gui->unlock_window();
        }
 
        startup_lock->lock("BatchRenderLoadList::run");
index fe0ec15fa082e247f3f48cf3a04108303dc91dc5..e4e281466dff68b862f85224eb0e6596023ca51e 100644 (file)
@@ -466,8 +466,9 @@ long FileXML::length()
        return buffer->otell();
 }
 
-char* FileXML::read_text()
+char* FileXML::read_text(const char *tag_title)
 {
+       if( !tag_title ) tag_title = tag.title;
        int ch = buffer->next();
 // filter out first char is new line
        if( ch == '\n' ) ch = buffer->next();
@@ -480,7 +481,7 @@ char* FileXML::read_text()
                if( ch < 0 ) break;
                pos = buffer->itell()-1;
                if( (ch = buffer->next()) != '/' ) continue;
-               char *cp = tag.title;
+               const char *cp = tag_title;
                while( (ch=buffer->next()) >= 0 && ch == *cp ) ++cp;
                if( ch < 0 ) break;
                if( *cp ) continue;
index eb0b514a6777056c0a7309b3aa302dd30322c755..a8bcc736fc385daf572e2178390ef56e0f9f4835 100644 (file)
@@ -136,7 +136,7 @@ public:
        int append_data(const char *text);
        int append_data(const char *text, long len);
 
-       char *read_text();
+       char *read_text(const char *tag_title=0);
        int read_data_until(const char *tag_end, XMLBuffer *xbfr, int skip=0);
        int read_text_until(const char *tag_end, XMLBuffer *xbfr, int skip=0);
        int read_tag();