fix render progress booby, add batchrender warn for zero length, click to play layout...
authorGood Guy <[email protected]>
Wed, 28 Aug 2019 03:33:19 +0000 (21:33 -0600)
committerGood Guy <[email protected]>
Wed, 28 Aug 2019 03:33:19 +0000 (21:33 -0600)
cinelerra-5.1/cinelerra/batchrender.C
cinelerra-5.1/cinelerra/batchrender.h
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/cinelerra/wwindow.C
cinelerra-5.1/thirdparty/Makefile

index 40ed1b0b68bb33581fc33815af8bd48a82f1fdb2..e3ff86e127727d2d10141e12769fa50eea9ed89e 100644 (file)
@@ -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 && i<jobs.size(); ++i ) {
                if( !jobs.values[i]->enabled ) 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; i<mismatched; ++i ) {
+                       int no = not_equiv[i].no;  const char *path = not_equiv[i].path;
+                       fprintf(stderr, "%d: %s\n", no, path);
+                       sp += snprintf(sp,ep-sp, "%d: %s\n", no, path);
+               }
+               sp += snprintf(sp,ep-sp, _("press cancel to abandon batch render"));
                mwindow->show_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; i<empty; ++i ) {
+                       int no = empty_jobs[i].no;  const char *path = empty_jobs[i].path;
+                       fprintf(stderr, "%d: %s\n", no, path);
+                       sp += snprintf(sp,ep-sp, "%d: %s\n", no, path);
+               }
+               sp += snprintf(sp,ep-sp, _("press cancel to abandon batch render"));
+               mwindow->show_warning(0, string);
+               if( mwindow->wait_warning() ) {
+                       gui->button_enable();
+                       is_rendering = 0;
+                       ret = 1;
+               }
+       }
+
        return ret;
 }
 
index 90e35855dd63332524e50f45ca128e20aa6d1025..5fcff0864f614740006a36766f5e97742b763362 100644 (file)
@@ -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<BatchRenderWarnJob>
+{
+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
 {
index 3d7703c2150ed09cf8c3f9ea7c504988f3d9ec19..2cb6b27fbbe073a6cf0b643145e80591848e1b11 100644 (file)
@@ -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;
index faa62ddba9e878ae0b55c9667dbc8c2bdf456aad..7a7d5407e9785482cca0ae46f55993bb47f98c8f 100644 (file)
@@ -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();
index 8bbc8352cf9a5ec33c4b1bcdbf7d2f2b1969e8b5..cdfa5349526c6470234d904a16763eb2cc88d2b0 100644 (file)
@@ -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));
index 715cabf619f8a9b325d8136d03d457f10d3a3948..905731e14cc3e551fe1892285b1dd6b5698e4e84 100644 (file)
@@ -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