1 diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
2 index 18590e3a..a60c71d1 100644
3 --- a/cinelerra-5.1/cinelerra/Makefile
4 +++ b/cinelerra-5.1/cinelerra/Makefile
5 @@ -395,6 +395,7 @@ LIBS += -lfontconfig -lfreetype
6 LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
7 LIBS += -lswresample -lswscale
8 LIBS += -lvpx -lwebp -lwebpmux
9 +LIBS += -lintl -liconv -lexecinfo
11 LIBS += $(if $(filter fftw,$(static_pkgs)), -lfftw3)
12 LIBS += $(if $(filter flac,$(static_pkgs)), -lFLAC)
13 @@ -476,6 +477,7 @@ LV2OBJS = \
17 + -I/usr/local/include \
21 @@ -523,15 +525,15 @@ all: $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
22 $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
23 $(LINKER) `cat $(OBJDIR)/objs`
24 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
25 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
26 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
27 ln -f -s ../bin/$(WANT_CIN) ci
29 ifneq ($(WANT_COMMERCIAL),no)
30 $(CUTADS): $(CUTOBJS) $(CUTLIBS) $(LIBRARIES)
31 - @echo g++ -o $@ $(CUTOBJS)
32 - @g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
33 + @echo $(CXX) -o $@ $(CUTOBJS)
34 + @$(CXX) $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
35 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo)
36 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
37 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
40 cp -av $(OBJDIR)/cutads $(BINDIR)/.
41 @@ -540,18 +542,18 @@ install: install-cutads
44 $(BDWRITE): $(BDWOBJS) $(LIBRARIES)
45 - @echo g++ -o $@ $(BDWOBJS)
46 - @g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
47 + @echo $(CXX) -o $@ $(BDWOBJS)
48 + @$(CXX) $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
49 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(BDWRITE) $(BDWRITE).debuginfo)
50 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
51 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
54 cp -av $(OBJDIR)/bdwrite $(BINDIR)/.
55 install: install-bdwrite
57 ydiff: ydiff.C $(LIBRARIES)
58 - @echo g++ -o $@ ydiff.C
59 - @g++ $(CFLAGS) ydiff.C -o $@ $(LIBS)
60 + @echo $(CXX) -o $@ ydiff.C
61 + @$(CXX) $(CFLAGS) ydiff.C -o $@ $(LIBS)
65 @@ -585,7 +587,7 @@ $(OBJDIR)/lv2ui: $(LV2OBJS)
66 @echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
67 @$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
68 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(LV2UI) $(LV2UI).debuginfo)
69 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
70 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
74 diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
75 index 27f728ad..9215090d 100644
76 --- a/cinelerra-5.1/cinelerra/bdcreate.C
77 +++ b/cinelerra-5.1/cinelerra/bdcreate.C
82 -#include <sys/stat.h>
83 -#include <sys/statfs.h>
84 +#include <sys/param.h>
85 +#include <sys/mount.h>
89 diff --git a/cinelerra-5.1/cinelerra/bdwrite.C b/cinelerra-5.1/cinelerra/bdwrite.C
90 index 6a2b4ca3..78cf9bef 100644
91 --- a/cinelerra-5.1/cinelerra/bdwrite.C
92 +++ b/cinelerra-5.1/cinelerra/bdwrite.C
98 +#include <sys/endian.h>
100 #include <sys/stat.h>
101 // work arounds (centos)
102 diff --git a/cinelerra-5.1/cinelerra/cutads.C b/cinelerra-5.1/cinelerra/cutads.C
103 index ac58d56a..f6690cf2 100644
104 --- a/cinelerra-5.1/cinelerra/cutads.C
105 +++ b/cinelerra-5.1/cinelerra/cutads.C
108 #define fail(s) do { printf("fail %s%s:%d\n",__func__,#s,__LINE__); return 1; } while(0)
110 -/* missing from system headers, no /usr/include <linux/ioprio.h>
111 - * IOPRIO_WHO_PROCESS, IOPRIO_CLASS_SHIFT, IOPRIO_CLASS_IDLE */
112 -enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, };
113 -#define IO_CLASS(n) (((int)(n)) << 13)
114 -#define IO_WHO_PROCESS 1
115 -#include <sys/syscall.h>
116 -#include <asm/unistd.h>
118 // commercial edge detection:
119 // must have audio < min_audio
120 // and within +- check_margin seconds of low audio
121 @@ -55,11 +47,6 @@ class Video;
125 -static int ioprio_set(int which, int who, int ioprio)
127 - return syscall(SYS_ioprio_set, which, who, ioprio);
130 static inline int clip(int v, int mn, int mx)
132 return v<mn ? mn : v>mx ? mx : v;
133 @@ -617,7 +604,6 @@ class Scan
134 const char *asset_path;
135 static void set_priority(int pr, int io) {
136 setpriority(PRIO_PROCESS, 0, pr); // lowest cpu priority
137 - ioprio_set(IO_WHO_PROCESS, 0, IO_CLASS(io));
139 class low_priority { public:
140 low_priority() { set_priority(19, IOPRIO_CLASS_IDLE); }
141 diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C
142 index 1014baf5..f38094e9 100644
143 --- a/cinelerra-5.1/cinelerra/dvdcreate.C
144 +++ b/cinelerra-5.1/cinelerra/dvdcreate.C
149 -#include <sys/stat.h>
150 -#include <sys/statfs.h>
151 +#include <sys/param.h>
152 +#include <sys/mount.h>
155 #define DVD_PAL_4x3 0
156 diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C
157 index 03348e0a..552a140d 100644
158 --- a/cinelerra-5.1/cinelerra/file.C
159 +++ b/cinelerra-5.1/cinelerra/file.C
160 @@ -1584,7 +1584,10 @@ int File::record_fd()
161 void File::get_exe_path(char *result, char *bnp)
163 // Get executable path, basename
164 - int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
165 + char exe_path[BCTEXTLEN];
166 + sprintf(exe_path,"/proc/%d/file",getpid());
167 + int len = readlink(exe_path, result, BCTEXTLEN-1);
171 char *ptr = strrchr(result, '/');
172 diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C
173 index 3d21d2af..f3064199 100644
174 --- a/cinelerra-5.1/cinelerra/indexfile.C
175 +++ b/cinelerra-5.1/cinelerra/indexfile.C
178 #include <sys/types.h>
179 #include <sys/stat.h>
180 -#include <linux/iso_fs.h>
181 +#include <isofs/cd9660/iso.h>
183 // check for isofs volume_id for dvd/cdrom
185 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
186 index 6fba32bb..ccdb683b 100644
187 --- a/cinelerra-5.1/configure.ac
188 +++ b/cinelerra-5.1/configure.ac
189 @@ -16,15 +16,26 @@ CFG_CFLAGS+=" -Wno-unused-result"
190 CFG_CFLAGS+=" -Wno-stringop-overflow"
191 CFG_CFLAGS+=" -Wno-format-truncation"
192 CFG_CFLAGS+=" -Wno-format-overflow"
193 +CFG_CFLAGS+=" -Wno-unknown-warning-option"
194 CFG_CFLAGS+=" -Wno-parentheses"
195 CFG_CFLAGS+=" -Wno-stringop-truncation"
196 +CFG_CFLAGS+=" -Wno-gnu-designator"
197 +CFG_CFLAGS+=" -Wno-missing-braces"
198 +CFG_CFLAGS+=" -Wno-overloaded-virtual"
199 +CFG_CFLAGS+=" -Wno-self-assign-field"
200 +CFG_CFLAGS+=" -Wno-sometimes-uninitialized"
201 +CFG_CFLAGS+=" -Wno-tautological-pointer-compare"
202 +CFG_CFLAGS+=" -Wno-unused-function"
203 +CFG_CFLAGS+=" -Wno-unused-private-field"
204 +CFG_CFLAGS+=" -Wno-infinite-recursion"
205 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
206 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
207 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
208 CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
209 -CFG_CFLAGS+=" -I/usr/include/freetype2"
210 -CFG_CFLAGS+=" -I/usr/include/uuid"
211 -CFG_CFLAGS+=" -I/usr/include/mjpegtools"
212 +CFG_CFLAGS+=" -I/usr/local/include"
213 +CFG_CFLAGS+=" -I/usr/local/include/freetype2 -I/usr/include/freetype2"
214 +CFG_CFLAGS+=" -I/usr/local/include/uuid -I/usr/include/uuid"
215 +CFG_CFLAGS+=" -I/usr/local/include/mjpegtools -I/usr/include/mjpegtools"
217 AC_DEFUN([CHECK_WITH], [
219 diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
220 index 8ee88002..9a17091e 100644
221 --- a/cinelerra-5.1/db/tdb.h
222 +++ b/cinelerra-5.1/db/tdb.h
223 @@ -32,7 +32,7 @@ inline void operator delete[](void *t,size_t n) { free(t); }
232 diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h
233 index f5994d53..c73169bb 100644
234 --- a/cinelerra-5.1/guicast/bclistbox.h
235 +++ b/cinelerra-5.1/guicast/bclistbox.h
236 @@ -185,7 +185,9 @@ public:
238 // take_focus - used by the suggestion box to keep it from taking focus from the
240 - int activate(int take_focus = 1);
241 + int activate() { return activate(1); }
242 + int activate(int take_focus);
244 int activate(int x, int y, int w=-1, int h=-1);
247 diff --git a/cinelerra-5.1/guicast/bcpan.h b/cinelerra-5.1/guicast/bcpan.h
248 index 40f5971f..73d47586 100644
249 --- a/cinelerra-5.1/guicast/bcpan.h
250 +++ b/cinelerra-5.1/guicast/bcpan.h
251 @@ -93,7 +93,8 @@ public:
254 static int rdtoxy(int &x, int &y, int a, int virtual_r);
255 - int activate(int popup_x = -1, int popup_y = -1);
256 + int activate(int popup_x, int popup_y);
257 + int activate() { return activate(-1,-1); }
261 diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
262 index e3400600..3cf616f8 100644
263 --- a/cinelerra-5.1/guicast/bcresources.C
264 +++ b/cinelerra-5.1/guicast/bcresources.C
265 @@ -695,7 +695,7 @@ new_vframes(20,default_medium_7segment,
266 generic_button_margin = 15;
267 draw_clock_background=1;
274 @@ -1681,6 +1681,87 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style,
280 + uint8_t *obfr, *out, *oend;
281 + uint8_t *ibfr, *inp, *iend;
283 + utf8conv(void *out, int olen, void *inp, int ilen) {
284 + this->obfr = this->out = (uint8_t*)out;
285 + this->oend = this->out + olen;
286 + this->ibfr = this->inp = (uint8_t*)inp;
287 + this->iend = this->inp + ilen;
289 + int cur() { return inp>=iend ? -1 : *inp; }
290 + int next() { return inp>=iend ? -1 : *inp++; }
291 + int next(int ch) { return out>=oend ? -1 : *out++ = ch; }
292 + int ilen() { return inp-ibfr; }
293 + int olen() { return out-obfr; }
295 + int wnext(unsigned int v);
299 +wnext(unsigned int v)
301 + if( v < 0x00000080 ) { next(v); return 1; }
302 + int n = v < 0x00000800 ? 2 : v < 0x00010000 ? 3 :
303 + v < 0x00200000 ? 4 : v < 0x04000000 ? 5 : 6;
304 + int m = (0xff00 >> n), i = n-1;
305 + next((v>>(6*i)) | m);
306 + while( --i >= 0 ) next(((v>>(6*i)) & 0x3f) | 0x80);
313 + int v = 0, n = 0, ch = next();
315 + switch( (ch=next()) ) {
316 + case 'n': return '\n';
317 + case 't': return '\t';
318 + case 'r': return '\r';
319 + case 'b': return '\b';
320 + case 'f': return '\f';
321 + case 'v': return '\v';
322 + case 'a': return '\a';
323 + case '0': case '1': case '2': case '3':
324 + case '4': case '5': case '6': case '7':
326 + for( int i=3; --i>0; v=v*8+ch, next() )
327 + if( (ch=cur()-'0') < 0 || ch >= 8 ) break;
329 + case 'x': n = 2; break;
330 + case 'u': n = 4; break;
331 + case 'U': n = 8; break;
332 + default: return ch;
334 + for( int i=n; --i>=0; v=v*16+ch, next() ) {
335 + if( (ch=cur()-'0')>=0 && ch<10 ) continue;
336 + if( (ch-='A'-'0'-10)>=10 && ch<16 ) continue;
337 + if( (ch-='a'-'A')<10 || ch>=16 ) break;
340 + else if( ch >= 0x80 ) {
341 + static const unsigned char byts[] = {
342 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5,
345 + n = i<0 ? 0 : byts[i/4];
346 + for( v=ch, i=n; --i>=0; v+=next() ) v <<= 6;
347 + static const unsigned int ofs[6] = {
348 + 0x00000000U, 0x00003080U, 0x000E2080U,
349 + 0x03C82080U, 0xFA082080U, 0x82082080U
359 size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
360 char *input, int input_length, char *output, int output_length)
362 @@ -1688,10 +1769,12 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
364 char *outbase = output;
366 - if(!from_enc || *from_enc == 0)
367 + if( !from_enc || *from_enc == 0 ||
368 + !strcmp(from_enc,"UTF8") || !strcmp(from_enc, "US-ASCII") )
371 - if(!to_enc || *to_enc == 0)
372 + if( !to_enc || *to_enc == 0 ||
373 + !strcmp(to_enc,"UTF8") || !strcmp(to_enc, "US-ASCII") )
377 @@ -1701,32 +1784,45 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
379 if(strcmp(from_enc, to_enc) && inbytes)
381 - if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1)
382 + if( !strcmp(from_enc, "UTF-8") && !strcmp(to_enc,"UTF32LE") ) {
383 + utf8conv uc(0,0, input,inbytes);
384 + uint32_t *op = (uint32_t *)output;
385 + uint32_t *ep = (uint32_t *)(output+output_length);
386 + for( int wch; op<ep && (wch=uc.wnext())>=0; *op++=wch );
387 + output = (char *)op;
388 + outbytes = (char*)ep - output;
390 + else if( !strcmp(from_enc, "UTF32LE") && !strcmp(to_enc,"UTF-8") ) {
391 + utf8conv uc(output,output_length, 0,0);
392 + uint32_t *ip = (uint32_t *)input;
393 + uint32_t *ep = (uint32_t *)(input+inbytes);
394 + for( ; ip<ep && uc.wnext(*ip)>=0; ++ip );
395 + output += uc.olen();
396 + outbytes = output_length-uc.olen();
398 + else if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1)
400 printf(_("Conversion from %s to %s is not available\n"),
405 - outbytes = output_length - 1;
407 - iconv(cd, &input, &inbytes, &output, &outbytes);
410 - inbytes = output - outbase;
412 + outbytes = output_length - 1;
413 + iconv(cd, &input, &inbytes, &output, &outbytes);
419 memcpy(output, input, inbytes);
423 - for(int i = 0; i < 4; i++)
425 + if( outbytes > sizeof(uint32_t) )
426 + outbytes = sizeof(uint32_t);
427 + for(int i = 0; i < outbytes; i++)
429 - if(outbytes-- == 0)
433 + return output - outbase;
436 void BC_Resources::encode_to_utf8(char *buffer, int buflen)
437 diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
438 index ed50cfb1..f1b894ba 100644
439 --- a/cinelerra-5.1/guicast/bcsignals.C
440 +++ b/cinelerra-5.1/guicast/bcsignals.C
442 #include <sys/stat.h>
444 #include <sys/ioctl.h>
445 -#include <sys/prctl.h>
446 #include <sys/types.h>
448 +#define dirent64 dirent
449 +#define readdir64 readdir
451 BC_Signals* BC_Signals::global_signals = 0;
452 static int signal_done = 0;
454 @@ -279,18 +281,6 @@ static void handle_exit(int signum)
456 void BC_Signals::set_sighup_exit(int enable)
459 -// causes SIGHUP to be generated when parent dies
460 - signal(SIGHUP, handle_exit);
461 - prctl(PR_SET_PDEATHSIG, SIGHUP, 0,0,0);
462 -// prevents ^C from signalling child when attached to gdb
464 - if( isatty(0) ) ioctl(0, TIOCNOTTY, 0);
467 - signal(SIGHUP, signal_entry);
468 - prctl(PR_SET_PDEATHSIG, 0,0,0,0);
472 BC_Signals::BC_Signals()
473 @@ -383,11 +373,13 @@ const char* BC_Signals::sig_to_str(int number)
474 #include <sys/wait.h>
477 +#define SC_(r)sc_##r
489 @@ -473,26 +465,5 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
492 if( fp != stdout ) fclose(fp);
493 - char cmd[1024], *cp = cmd;
494 - cp += sprintf(cp, "exec gdb /proc/%d/exe -p %d --batch --quiet "
495 - "-ex \"thread apply all info registers\" "
496 - "-ex \"thread apply all bt full\" "
497 - "-ex \"quit\"", pid, pid);
499 - cp += sprintf(cp," >> \"%s\"", fn);
500 - cp += sprintf(cp," 2>&1");
501 -//printf("handle_dump:: pid=%d, cmd='%s' fn='%s'\n",pid,cmd,fn);
504 - fprintf(stderr,"** can't start gdb, dump abondoned\n");
509 - fprintf(stderr,"** dump complete\n");
512 - char *const argv[4] = { (char*) "/bin/sh", (char*) "-c", cmd, 0 };
513 - execvp(argv[0], &argv[0]);
516 diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C
517 index ebc2007d..9d6452cb 100644
518 --- a/cinelerra-5.1/guicast/filesystem.C
519 +++ b/cinelerra-5.1/guicast/filesystem.C
524 +#define dirent64 dirent
525 +#define readdir64 readdir
527 #include "filesystem.h"
529 diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
530 index dff53e61..321ab4fc 100644
531 --- a/cinelerra-5.1/guicast/thread.C
532 +++ b/cinelerra-5.1/guicast/thread.C
533 @@ -55,13 +55,6 @@ void* Thread::entrypoint(void *parameters)
534 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
535 thread->cancel_enabled = false;
537 -// Set realtime here seince it doesn't work in start
538 - if( thread->realtime && getuid() == 0 ) {
539 - struct sched_param param = { sched_priority : 1 };
540 - if(pthread_setschedparam(thread->tid, SCHED_RR, ¶m) < 0)
541 - perror("Thread::entrypoint pthread_attr_setschedpolicy");
545 thread->finished = true;
546 if( !thread->synchronous ) {
547 diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h
548 index 216ecd2b..8ebec237 100644
549 --- a/cinelerra-5.1/guicast/thread.h
550 +++ b/cinelerra-5.1/guicast/thread.h
553 #include <sys/syscall.h>
555 -static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
556 +static inline long gettid() { return (long)pthread_self(); }
558 // The thread does not autodelete by default.
559 // If autodelete is 1 the thread autodeletes.
560 diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
561 index 6ed357c7..56081181 100644
562 --- a/cinelerra-5.1/plugins/Makefile
563 +++ b/cinelerra-5.1/plugins/Makefile
564 @@ -31,7 +31,6 @@ DIRS = $(OPENCV_OBJS) \
572 @@ -161,6 +160,8 @@ DIRS = $(OPENCV_OBJS) \
579 PLUGIN_DIR = $(BINDIR)/plugins
580 DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
581 diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C
582 index fefbbdb1..045e96d4 100644
583 --- a/cinelerra-5.1/plugins/titler/titler.C
584 +++ b/cinelerra-5.1/plugins/titler/titler.C
590 -#include <byteswap.h>
591 +#include <sys/endian.h>
593 #include <sys/stat.h>
594 #include <fontconfig/fontconfig.h>