From: Good Guy Date: Thu, 11 Jun 2020 20:18:32 +0000 (-0600) Subject: fix bug in batchrender job load from xml X-Git-Tag: 2020-06~10 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=6c1465645d68ce303a0651a07781567869351840;p=goodguy%2Fcinelerra.git fix bug in batchrender job load from xml --- diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 9703361c..0694cc2f 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -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"); diff --git a/cinelerra-5.1/cinelerra/filexml.C b/cinelerra-5.1/cinelerra/filexml.C index fe0ec15f..e4e28146 100644 --- a/cinelerra-5.1/cinelerra/filexml.C +++ b/cinelerra-5.1/cinelerra/filexml.C @@ -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; diff --git a/cinelerra-5.1/cinelerra/filexml.h b/cinelerra-5.1/cinelerra/filexml.h index eb0b514a..a8bcc736 100644 --- a/cinelerra-5.1/cinelerra/filexml.h +++ b/cinelerra-5.1/cinelerra/filexml.h @@ -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();