fix segv ffmpeg opts popup, minor enhancements, hi-bits compile switch
authorGood Guy <good1.2guy@gmail.com>
Wed, 11 May 2016 18:43:04 +0000 (12:43 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 11 May 2016 18:43:04 +0000 (12:43 -0600)
cinelerra-5.1/cinelerra/dvdcreate.C
cinelerra-5.1/cinelerra/fileffmpeg.C
cinelerra-5.1/cinelerra/fileffmpeg.h
cinelerra-5.1/ffmpeg/video/bluray422.m2ts [moved from cinelerra-5.1/ffmpeg/video/bluray1.m2ts with 100% similarity]
cinelerra-5.1/global_config
cinelerra-5.1/thirdparty/Makefile

index 66d93793bdd31956c07c04c831f05181cc3da512..f61078148bedaf8cfae29f0725f54926cfe64d36 100644 (file)
@@ -180,6 +180,9 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList<BatchRenderJob*> *jobs,
        fprintf(fp,"rm -rf $1/iso\n");
        fprintf(fp,"mkdir -p $1/iso\n");
        fprintf(fp,"\n");
+// dvdauthor ver 0.7.0 requires this to work
+       fprintf(fp,"export VIDEO_FORMAT=%s\n",
+               use_standard == HD_720x576_2500 ? "PAL" : "NTSC");
        fprintf(fp,"dvdauthor -x - <<eof\n");
        fprintf(fp,"<dvdauthor dest=\"$1/iso\">\n");
        fprintf(fp,"  <vmgm>\n");
index 23e391df2b4c417c1a2ca4cf33efaa49c6ff9759..9ac47e56b18001e19619176831094b2f855e586d 100644 (file)
@@ -10,6 +10,7 @@
 #include "asset.h"
 #include "bcwindowbase.h"
 #include "bitspopup.h"
+#include "ctype.h"
 #include "ffmpeg.h"
 #include "filebase.h"
 #include "file.h"
@@ -481,6 +482,7 @@ FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset)
 
 FFMPEGConfigVideo::~FFMPEGConfigVideo()
 {
+       delete ff_options_dialog;
        lock_window("FFMPEGConfigVideo::~FFMPEGConfigVideo");
        if(preset_popup) delete preset_popup;
        presets.remove_all_objects();
@@ -792,7 +794,7 @@ FFOptions_Opt::~FFOptions_Opt()
 
 char *FFOptions_Opt::get(char *vp, int sz)
 {
-       char *cp = vp, *ep = vp+sz-1;
+       char *cp = vp;
        *cp = 0;
        if( !opt ) return cp;
 
@@ -808,10 +810,8 @@ char *FFOptions_Opt::get(char *vp, int sz)
                 cp = sz >= 0 ? strncpy(vp,val,sz) : strcpy(vp, val);
                 if( sz > 0 ) vp[sz-1] = 0;
                 av_freep(&bp);
-               return cp;
         }
 
-       *vp = 0;
        return cp;
 }
 
@@ -1088,6 +1088,50 @@ void FFOptionsWindow::update(FFOptions_Opt *opt)
        panel->update();
 }
 
+void FFOptions_OptPanel::show_tip(const char *tip)
+{
+       if( !tip ) return;
+       int len = strlen(tip);
+       if( len > (int)sizeof(tip_text)-1 ) len = sizeof(tip_text)-1;
+       strncpy(tip_text,tip,len);
+       tip_text[len] = 0;
+       int line_limit = 60;
+       int limit2 = line_limit/2;
+       int limit4 = line_limit/4-2;
+       char *cp = tip_text, *dp = cp+len;
+       int n;  char *bp, *ep, *pp, *sp;
+       while( cp < dp ) {
+               for( ep=cp; ep<dp && *ep!='\n'; ++ep );
+               // target about half remaining line, constrain line_limit
+               if( (n=(ep-1-cp)/2) < limit2 || n > line_limit )
+                       n = line_limit;
+               // search for last punct, last space before line_limit
+               for( bp=cp, pp=sp=0; --n>=0 && cp<ep; ++cp ) {
+                       if( ispunct(*cp) && isspace(*(cp+1)) ) pp = cp;
+                       else if( isspace(*cp) ) sp = cp;
+               }
+               // line not empty
+               if( cp < ep ) {
+                       // first, after punctuation
+                       if( pp && pp-bp >= limit4 )
+                               cp = pp+1;
+                       // then, on spaces
+                       else if( sp ) {
+                               cp = sp;
+                       }
+                       // last, on next space
+                       else {
+                               while( cp<dp && !isspace(*cp) ) ++cp;
+                       }
+                       // add new line
+                       if( !*cp ) break;
+                       *cp++ = '\n';
+               }
+       }
+       fwin->panel->set_tooltip(tip_text);
+       fwin->panel->show_tooltip();
+}
+
 int FFOptions_OptPanel::selection_changed()
 {
        FFOptions_Opt *opt = 0;
@@ -1097,8 +1141,7 @@ int FFOptions_OptPanel::selection_changed()
                opt = opt_name->opt;
        }
        fwin->update(opt);
-       fwin->panel->set_tooltip(!opt ? 0 : opt->tip());
-       fwin->panel->show_tooltip();
+       if( opt ) show_tip(opt->tip());
        return 1;
 }
 
@@ -1415,6 +1458,7 @@ FFOptionsAudioDialog::FFOptionsAudioDialog(FFMPEGConfigAudio *aud_config)
 
 FFOptionsAudioDialog::~FFOptionsAudioDialog()
 {
+       close_window();
 }
 
 void FFOptionsAudioDialog::update_options()
@@ -1429,6 +1473,7 @@ FFOptionsVideoDialog::FFOptionsVideoDialog(FFMPEGConfigVideo *vid_config)
 
 FFOptionsVideoDialog::~FFOptionsVideoDialog()
 {
+       close_window();
 }
 
 void FFOptionsVideoDialog::update_options()
index a9ce7d9cf458bd3d90efeb85a4611aeafa9ea3b0..9bd9e5beadbe37d6e28760ecbbb0768240432a81 100644 (file)
@@ -288,9 +288,11 @@ public:
        ArrayList<BC_ListBoxItem*> items[2];
        ArrayList<BC_ListBoxItem*> &opts;
        ArrayList<BC_ListBoxItem*> &vals;
+       char tip_text[BCTEXTLEN];
 
        int selection_changed();
        int update();
+       void show_tip(const char *tip);
 };
 
 class FFOptionsKindItem : public BC_MenuItem
index b24b08f3723d93b1ec7ee572e2f04ade949d67ae..9860da83ea6f23666d8f21a6bddf853ce657462a 100644 (file)
@@ -10,6 +10,8 @@ HAVE_XFT := y
 HAVE_VIDEO4LINUX := n
 # build thirdparty ladspa
 HAVE_LADSPA := y
+# x264/x265 build flags
+HAVE_HIGH_DEPTH := n
 
 # probed, uncomment and set to override probe
 #STATIC_LIBRARIES := y
@@ -133,3 +135,4 @@ endif
 CFLAGS += -D__STDC_CONSTANT_MACROS
 CFLAGS += -D__STDC_LIMIT_MACROS
 CFLAGS += -DPNG_SKIP_SETJMP_CHECK=1
+EXTRA_LIBS += -lbluray
index 264998dc0cb237ee0d337d78a740517be610b897..60ce5983f11446d6e38739dbca25b959c2729fd5 100644 (file)
@@ -187,8 +187,11 @@ openexr.cfg_params=--enable-shared=no
 openexr.cfg_params+=--with-ilmbase-prefix=$(call bld_path,ilmbase,usr)
 speech_tools.mak_params=-j1
 twolame.cfg_params=--enable-shared=no
-x264.cfg_params= --enable-static
-x265.cfg_vars=echo "exec cmake source -DENABLE_SHARED=no" > ./configure; chmod +x ./configure;
+#$(error HAVE_HIGH_DEPTH $(HAVE_HIGH_DEPTH))
+x264.cfg_params= --enable-static $(if $(filter y,$(HAVE_HIGH_DEPTH)),--bit-depth=10)
+x265.cfg_vars=echo "exec cmake source -DENABLE_SHARED=no \
+ $(if $(filter y,$(HAVE_HIGH_DEPTH)),-DBUILD_SHARED_LIBS:BOOL=HIGH_BIT_DEPTH) \
+" > ./configure; chmod +x ./configure;
 
 # compile flag vars
 $(foreach tgt,$(TARGETS), \