X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fbatchrender.C;h=d67b6ad1a5342b921c61ad54476768c208dda304;hp=ae1cef938410cd79ceefa0a9592cde373f79704f;hb=9afc3844e37c6db23435d5d0c33129dcc81061e4;hpb=010024a919b463542b843cf2dd50e0ccb30f1269 diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index ae1cef93..d67b6ad1 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -398,23 +398,26 @@ int BatchRenderThread::test_edl_files() FILE *fp = fopen(path, "r"); if( fp ) { if( warn && mwindow && !is_script ) { - fseek(fp, 0, SEEK_END); - int64_t sz = ftell(fp); - fseek(fp, 0, SEEK_SET); - char *bfr = new char[sz+1]; - int64_t len = fread(bfr, 1, sz+1, fp); - if( len == sz ) { - FileXML file; - XMLBuffer data(bfr, len, 0); - file.set_shared_input(&data); + char *bfr = 0; size_t sz = 0; + struct stat st; + if( !fstat(fileno(fp), &st) ) { + sz = st.st_size; + bfr = new char[sz+1]; + if( fread(bfr, 1, sz+1, fp) != sz ) + ret = 1; + else + bfr[sz] = 0; + } + if( !ret ) { EDL *edl = new EDL; edl->create_objects(); - edl->load_xml(&file, LOAD_ALL); + XMLBuffer data(bfr, sz, 0); + { FileXML file; + file.set_shared_input(&data); + edl->load_xml(&file, LOAD_ALL); } double pos = edl->equivalent_output(mwindow->edl); if( pos >= 0 ) ++not_equiv; edl->remove_user(); } - else - ret = 1; delete [] bfr; } fclose(fp); @@ -510,6 +513,7 @@ void BatchRenderThread::start_rendering(char *config_path, //PRINT_TRACE // Initialize stuff which MWindow does. signals->initialize("/tmp/cinelerra_batch%d.dmp"); + boot_defaults = 0; MWindow::init_defaults(boot_defaults, config_path); load_defaults(boot_defaults); preferences = new Preferences; @@ -1046,7 +1050,9 @@ void BatchRenderSaveList::run() int result2 = filewindow.run_window(); if( !result2 ) { strcpy(thread->batch_path, filewindow.get_submitted_path()); + thread->gui->lock_window("BatchRenderSaveList::run"); thread->gui->batch_path->update(thread->batch_path); + thread->gui->unlock_window(); thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path); thread->save_jobs(thread->batch_path); }