From: Good Guy Date: Sat, 13 May 2017 23:39:35 +0000 (-0600) Subject: update cfg-cv.sh, limit titler window text chars/bfrsz X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=586cb6f963c4ccc80e79606cf0bbdf9c35171ddc;p=goodguy%2Fhistory.git update cfg-cv.sh, limit titler window text chars/bfrsz --- diff --git a/cinelerra-5.1/cfg-cv.sh b/cinelerra-5.1/cfg-cv.sh index 35b1c7c3..5efad07d 100755 --- a/cinelerra-5.1/cfg-cv.sh +++ b/cinelerra-5.1/cfg-cv.sh @@ -1,13 +1,16 @@ #!/bin/bash -x # cd cincv; cfg_cv.sh /path/cin5 +# used git clone "git://git.cinelerra-cv.org/goodguy/cinelerra.git" "cinelerra5" +# ver: git checkout 135eb5f052a2f75e4df6c86511a94ec9586e096d (dec 30, 2016) cin="$1" THIRDPARTY=`pwd`/thirdparty +unset LIBS LDFLAGS CFLAGS CPPFLAGS CXXFLAGS rm -rf thirdparty; cp -a $cin/thirdparty . for f in configure.ac Makefile.am autogen.sh; do mv $f $f.cv; cp -a $cin/$f .; done mv m4 m4.cv rm -rf ./libzmpeg3 ./db -mkdir libzmpeg3 db db/utils +mkdir -p libzmpeg3 db db/utils mpeg2enc mplexlo ./autogen.sh ./configure --disable-static-build --without-ladspa-build \ @@ -35,21 +38,24 @@ static_incs=`make -C thirdparty -s val-static_incs` for f in configure.ac Makefile.am autogen.sh; do rm -f $f; mv $f.cv $f; done mv m4.cv m4 -export LDFLAGS=`for f in $static_libs; do +LDFLAGS=`for f in $static_libs; do if [ ! -f "$f" ]; then continue; fi; ls $f done | sed -e 's;/[^/]*$;;' | \ sort -u | while read d; do echo -n " -L$d"; done` +export LDFLAGS -export LIBS=-lpthread `for f in $static_libs; do +LIBS=`for f in $static_libs; do if [ ! -f "$f" ]; then continue; fi; ls $f done | sed -e 's;.*/;;' -e 's;lib\(.*\)\.a$;\1;' | \ sort -u | while read a; do echo -n " -l$a"; done` +LIBS+=" -lpthread" +export LIBS export CFLAGS="$static_incs" export CXXFLAGS="$static_incs" @@ -77,8 +83,43 @@ echo LDFLAGS=$LDFLAGS echo LIBS=$LIBS echo CFLAGS=$CFLAGS +export ac_cv_header_xmmintrin_h=no +# -lmxxxxx dies, feed it a -lm early to prevent misformed parameters +export LIBS="-la52 -ldjbfft -lfaac -lfaad -lHalf -lIex -lIexMath -lIlmThread -lImath -llavfile -llavjpeg -lm -lmjpegutils -lmmxsse -lmp3lame -lmp4ff -lmpeg2encpp -lmpgdecoder -lmplex2 -logg -lvorbis -lvorbisenc -lvorbisfile -lx264 -lyuvfilters -lpthread -ldl" +# po Makefile construction error: skip it +touch po/Makefile.in.in + +# uuid search path is not predictable, fake it +( cd thirdparty/libuuid-1.0.3/; ln -s . uuid ) +# old linker scripts want .libs/.libs path, fake it: +find thirdparty/ -name .libs | while read f ; do ( cd $f; ln -s . .libs ); done + ./configure +exit + +# have to rebuild these by hand +# cd plugins/libeffecttv/.libs/; rm libeffectv.a; ar r libeffecttv.a effecttv.o +# cd quicktime/encore50/.libs/; rm libencore.a; ar r libencore.a *.o +# cd quicktime; vi Makefile; remove -Wl,--no-undefined from:, make +# libquicktimecv_la_LDFLAGS = -version-info 1:0:0 -release 1.6.0 + +# shares do not want thirdparty link data: +( cd libmpeg3 + make clean + make LIBS= \ + LDFLAGS="-L$THIRDPARTY/a52dec-0.7.4/liba52/.libs \ + -L$THIRDPARTY/djbfft-0.76 -ldjbfft" ) +( cd guicast + make clean + make LIBS= LDFLAGS= ) +( cd plugins + for f in */Makefile; do + cp $f $f.sav1; sed -e "/^LIBS\>/d" -e "/^LDFLAGS\>/d" -i $f + done + make clean + make ) + #make -j$jobs >& log #make install DESTDIR=`pwd` >> log 2>&1 #export LD_LIBRARY_PATH=`pwd`/usr/local/lib diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index d4414060..9adf4e26 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -681,7 +681,7 @@ void TitleWindow::update_justification() void TitleWindow::update_stats() { text_chars->update(client->config.wlen); - int len = MESSAGESIZE-16 - strlen(text->get_text()); + int len = MESSAGESIZE - BCTEXTLEN - strlen(text->get_text()) - 1; if( len < 0 ) len = 0; text_bfrsz->update(len); } @@ -1064,6 +1064,18 @@ int TitleText::button_press_event() int TitleText::handle_event() { window->fonts_popup->deactivate(); + int text_len = strlen(get_text()); + int avail = MESSAGESIZE - BCTEXTLEN; + if( text_len >= avail ) { // back off last utf8 char + char text[2*sizeof(client->config.wtext)]; + strcpy(text, get_text()); + text_len = avail; + while( text_len > 0 && (text[text_len-1] & 0xc0) == 0x80 ) + text[--text_len] = 0; + if( text_len > 0 ) + text[--text_len] = 0; + update(text); + } int len = sizeof(client->config.wtext) / sizeof(wchar_t); wcsncpy(client->config.wtext, get_wtext(), len); client->config.wtext[len-1] = 0;