From: Good Guy Date: Wed, 11 May 2016 18:43:04 +0000 (-0600) Subject: fix segv ffmpeg opts popup, minor enhancements, hi-bits compile switch X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=a9bdd58fae360fa33d27caa059f5ca2c6fa26cd4;ds=sidebyside fix segv ffmpeg opts popup, minor enhancements, hi-bits compile switch --- diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index 66d93793..f6107814 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -180,6 +180,9 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *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 - <\n"); fprintf(fp," \n"); diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index 23e391df..9ac47e56 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -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 line_limit ) + n = line_limit; + // search for last punct, last space before line_limit + for( bp=cp, pp=sp=0; --n>=0 && cp= limit4 ) + cp = pp+1; + // then, on spaces + else if( sp ) { + cp = sp; + } + // last, on next space + else { + while( cppanel->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() diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.h b/cinelerra-5.1/cinelerra/fileffmpeg.h index a9ce7d9c..9bd9e5be 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.h +++ b/cinelerra-5.1/cinelerra/fileffmpeg.h @@ -288,9 +288,11 @@ public: ArrayList items[2]; ArrayList &opts; ArrayList &vals; + char tip_text[BCTEXTLEN]; int selection_changed(); int update(); + void show_tip(const char *tip); }; class FFOptionsKindItem : public BC_MenuItem diff --git a/cinelerra-5.1/ffmpeg/video/bluray1.m2ts b/cinelerra-5.1/ffmpeg/video/bluray422.m2ts similarity index 100% rename from cinelerra-5.1/ffmpeg/video/bluray1.m2ts rename to cinelerra-5.1/ffmpeg/video/bluray422.m2ts diff --git a/cinelerra-5.1/global_config b/cinelerra-5.1/global_config index b24b08f3..9860da83 100644 --- a/cinelerra-5.1/global_config +++ b/cinelerra-5.1/global_config @@ -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 diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile index 264998dc..60ce5983 100644 --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile @@ -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), \