From d034ec092c8aaf21c755bc612796df69ffdee4ac Mon Sep 17 00:00:00 2001 From: Good Guy Date: Tue, 27 Aug 2019 21:33:19 -0600 Subject: [PATCH] fix render progress booby, add batchrender warn for zero length, click to play layout fix, dav1d meson build fixes --- cinelerra-5.1/cinelerra/batchrender.C | 48 ++++++++++++++++++++++----- cinelerra-5.1/cinelerra/batchrender.h | 22 +++++++++--- cinelerra-5.1/cinelerra/editpanel.C | 2 +- cinelerra-5.1/cinelerra/render.C | 4 ++- cinelerra-5.1/cinelerra/wwindow.C | 3 +- cinelerra-5.1/thirdparty/Makefile | 5 +-- 6 files changed, 67 insertions(+), 17 deletions(-) diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 40ed1b0b..e3ff86e1 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -39,6 +39,7 @@ #include "keys.h" #include "labels.h" #include "language.h" +#include "localsession.h" #include "mainerror.h" #include "mainundo.h" #include "mainsession.h" @@ -412,8 +413,10 @@ char* BatchRenderThread::get_current_edl() // Test EDL files for existence int BatchRenderThread::test_edl_files() { - int not_equiv = 0, ret = 0; + int ret = 0; const char *path = 0; + BatchRenderWarnJobs not_equiv; + BatchRenderWarnJobs empty_jobs; for( int i=0; !ret && ienabled ) continue; @@ -422,7 +425,7 @@ int BatchRenderThread::test_edl_files() if( is_script ) ++path; FILE *fp = fopen(path, "r"); if( fp ) { - if( warn && mwindow && !is_script ) { + if( mwindow && !is_script ) { char *bfr = 0; size_t sz = 0; struct stat st; if( !fstat(fileno(fp), &st) ) { @@ -440,7 +443,10 @@ int BatchRenderThread::test_edl_files() file.set_shared_input(&data); edl->load_xml(&file, LOAD_ALL); } double pos = edl->equivalent_output(mwindow->edl); - if( pos >= 0 ) ++not_equiv; + if( pos >= 0 ) not_equiv.add(i+1, path); + double length = edl->tracks->total_playable_length(); + double start = edl->local_session->get_selectionstart(1); + if( start >= length ) empty_jobs.add(i+1, path); edl->remove_user(); } delete [] bfr; @@ -467,11 +473,18 @@ int BatchRenderThread::test_edl_files() } is_rendering = 0; } - else if( warn && mwindow && not_equiv > 0 ) { - fprintf(stderr, _("%d job EDLs do not match session edl\n"), not_equiv); - char string[BCTEXTLEN], *sp = string; - sp += sprintf(sp, _("%d job EDLs do not match session edl\n"),not_equiv); - sp += sprintf(sp, _("press cancel to abandon batch render")); + + int mismatched = not_equiv.size(); + if( is_rendering && warn && mwindow && mismatched > 0 ) { + fprintf(stderr, _("%d job EDLs do not match session edl\n"), mismatched); + char string[BCTEXTLEN], *sp = string, *ep = sp+sizeof(string)-1; + sp += snprintf(sp,ep-sp, _("%d job EDLs do not match session edl\n"),mismatched); + for( int i=0; ishow_warning(&warn, string); if( mwindow->wait_warning() ) { gui->button_enable(); @@ -481,6 +494,25 @@ int BatchRenderThread::test_edl_files() gui->warning->update(warn); } + int empty = empty_jobs.size(); + if( is_rendering && empty > 0 ) { + fprintf(stderr, _("%d job EDLs begin position beyond end of media\n"), empty); + char string[BCTEXTLEN], *sp = string, *ep = sp+sizeof(string)-1; + sp += snprintf(sp,ep-sp, _("%d job EDLs begin position beyond end of media\n"), empty); + for( int i=0; ishow_warning(0, string); + if( mwindow->wait_warning() ) { + gui->button_enable(); + is_rendering = 0; + ret = 1; + } + } + return ret; } diff --git a/cinelerra-5.1/cinelerra/batchrender.h b/cinelerra-5.1/cinelerra/batchrender.h index 90e35855..5fcff086 100644 --- a/cinelerra-5.1/cinelerra/batchrender.h +++ b/cinelerra-5.1/cinelerra/batchrender.h @@ -81,11 +81,25 @@ public: }; +class BatchRenderWarnJob +{ +public: + BatchRenderWarnJob() { no = 0; path = 0; } + ~BatchRenderWarnJob() { delete [] path; } + int no; + const char *path; +}; - - - - +class BatchRenderWarnJobs : public ArrayList +{ +public: + BatchRenderWarnJobs() {} + ~BatchRenderWarnJobs() {} + void add(int no, const char *path) { + BatchRenderWarnJob &job = append(); + job.no = no; job.path = cstrdup(path); + } +}; class BatchRenderThread : public BC_DialogThread { diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index 3d7703c2..2cb6b27f 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -165,7 +165,7 @@ int EditPanel::calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons int result = 0; int button_w = mwindow->theme->get_image_set("ibeam")[0]->get_w(); if( use_keyframe ) { - result += button_w + mwindow->theme->toggle_margin; + result += 2*(button_w + mwindow->theme->toggle_margin); } result += button_w * total_buttons; diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index faa62ddb..7a7d5407 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -460,8 +460,10 @@ void Render::start_progress() sprintf(string, _("Rendering %s..."), filename); // Don't bother with the filename since renderfarm defeats the meaning + mwindow->gui->lock_window("Render::start_progress"); progress = mwindow->mainprogress->start_progress(_("Rendering..."), progress_max); + mwindow->gui->unlock_window(); render_progress = new RenderProgress(mwindow, this); render_progress->start(); } @@ -478,7 +480,7 @@ void Render::stop_progress() delete progress; sprintf(string2, _("Rendering took %s"), string); - mwindow->gui->lock_window(""); + mwindow->gui->lock_window("Render::stop_progress"); mwindow->gui->show_message(string2); mwindow->gui->update_default_message(); mwindow->gui->stop_hourglass(); diff --git a/cinelerra-5.1/cinelerra/wwindow.C b/cinelerra-5.1/cinelerra/wwindow.C index 8bbc8352..cdfa5349 100644 --- a/cinelerra-5.1/cinelerra/wwindow.C +++ b/cinelerra-5.1/cinelerra/wwindow.C @@ -84,7 +84,8 @@ void WWindowGUI::create_objects() int x = 10, y = 10; add_subwindow(new BC_TextBox(x, y, get_w()-50, 3, thread->warn_text)); y = get_h() - 30; - add_subwindow(new WDisable(this, x, y)); + if( thread->do_warning ) + add_subwindow(new WDisable(this, x, y)); y = get_h() - BC_CancelButton::calculate_h() - 10; x = get_w() - BC_CancelButton::calculate_w() - 10; add_subwindow(new BC_CancelButton(x, y)); diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile index 715cabf6..905731e1 100644 --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile @@ -186,9 +186,10 @@ libaom.cfg_params?= -DENABLE_SHARED=no -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=$(call bld_path,libaom)/usr/local libaom.mak_params?= ; $(MAKE) -C libaom* install dav1d.cfg_vars?=\ - echo "meson build" > configure; \ + echo "meson setup . build" > configure; \ echo "meson configure build -Denable_tools=false" >> configure; \ - echo "meson build --buildtype release --default-library=both" >> configure; \ + echo "meson configure build --buildtype=release" >> configure; \ + echo "meson configure build --default-library=static" >> configure; \ chmod +x ./configure; dav1d.mak_vars?=(echo "all:"; echo " ninja -C build") > $(call bld_path,dav1d)/Makefile; dav1d.mak_params?=; cd "$(call bld_path,dav1d)"; DESTDIR="$(call bld_path,dav1d)" meson install -C build -- 2.26.2