Add back 2 patches for histogram and overlayframe that are working correctly and...
[goodguy/cinelerra.git] / cinelerra-5.1 / blds / bsd.patch
1 diff --git a/cinelerra-5.1/Makefile.devel b/cinelerra-5.1/Makefile.devel
2 index 5531330..ad671f5 100644
3 --- a/cinelerra-5.1/Makefile.devel
4 +++ b/cinelerra-5.1/Makefile.devel
5 @@ -4,7 +4,7 @@ TOPDIR := $(CURDIR)
6  CFLAGS ?= -ggdb
7  export CFLAGS_ := $(CFLAGS)
8  
9 -cpus:=$(shell grep -c "^proc" /proc/cpuinfo)
10 +cpus:=$(shell sysctl -n hw.ncpu)
11  jobs:=-j$(shell echo $$(($(cpus) + $(cpus)/2 +2)))
12  MAKEJ := $(MAKE) $(jobs)
13  
14 diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
15 index f4e536b..9b76136 100644
16 --- a/cinelerra-5.1/cinelerra/Makefile
17 +++ b/cinelerra-5.1/cinelerra/Makefile
18 @@ -512,7 +512,7 @@ all:        $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
19  $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
20         $(LINKER) `cat $(OBJDIR)/objs`
21         $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
22 -       $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
23 +       #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
24         ln -f -s ../bin/$(WANT_CIN) ci
25  
26  ifneq ($(WANT_COMMERCIAL),no)
27 diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
28 index e18ebee..eade28a 100644
29 --- a/cinelerra-5.1/cinelerra/bdcreate.C
30 +++ b/cinelerra-5.1/cinelerra/bdcreate.C
31 @@ -24,8 +24,8 @@
32  #include <unistd.h>
33  #include <fcntl.h>
34  #include <errno.h>
35 -#include <sys/stat.h>
36 -#include <sys/statfs.h>
37 +#include <sys/param.h>
38 +#include <sys/mount.h>
39  
40  // BD Creation
41  
42 diff --git a/cinelerra-5.1/cinelerra/bdwrite.C b/cinelerra-5.1/cinelerra/bdwrite.C
43 index 6a2b4ca..78cf9be 100644
44 --- a/cinelerra-5.1/cinelerra/bdwrite.C
45 +++ b/cinelerra-5.1/cinelerra/bdwrite.C
46 @@ -38,7 +38,7 @@
47  #include <stdint.h>
48  #include <stdlib.h>
49  #include <string.h>
50 -#include <endian.h>
51 +#include <sys/endian.h>
52  #include <limits.h>
53  #include <sys/stat.h>
54  // work arounds (centos)
55 diff --git a/cinelerra-5.1/cinelerra/cutads.C b/cinelerra-5.1/cinelerra/cutads.C
56 index ac58d56..f6690cf 100644
57 --- a/cinelerra-5.1/cinelerra/cutads.C
58 +++ b/cinelerra-5.1/cinelerra/cutads.C
59 @@ -23,14 +23,6 @@
60  using namespace std;
61  #define fail(s) do { printf("fail %s%s:%d\n",__func__,#s,__LINE__); return 1; } while(0)
62  
63 -/* missing from system headers, no /usr/include <linux/ioprio.h>
64 - *   IOPRIO_WHO_PROCESS, IOPRIO_CLASS_SHIFT, IOPRIO_CLASS_IDLE */
65 -enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, };
66 -#define IO_CLASS(n) (((int)(n)) << 13)
67 -#define IO_WHO_PROCESS  1
68 -#include <sys/syscall.h>
69 -#include <asm/unistd.h>
70 -
71  // commercial edge detection:
72  // must have audio < min_audio
73  //   and within +- check_margin seconds of low audio
74 @@ -55,11 +47,6 @@ class Video;
75  class Audio;
76  class Scan;
77  
78 -static int ioprio_set(int which, int who, int ioprio)
79 -{
80 -       return syscall(SYS_ioprio_set, which, who, ioprio);
81 -}
82 -
83  static inline int clip(int v, int mn, int mx)
84  {
85    return v<mn ? mn : v>mx ? mx : v;
86 @@ -617,7 +604,6 @@ class Scan
87         const char *asset_path;
88         static void set_priority(int pr, int io) {
89                 setpriority(PRIO_PROCESS, 0, pr);  // lowest cpu priority
90 -               ioprio_set(IO_WHO_PROCESS, 0, IO_CLASS(io));
91         }
92         class low_priority { public:
93                 low_priority() { set_priority(19, IOPRIO_CLASS_IDLE); }
94 diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C
95 index f4587fc..dd0c883 100644
96 --- a/cinelerra-5.1/cinelerra/dvdcreate.C
97 +++ b/cinelerra-5.1/cinelerra/dvdcreate.C
98 @@ -24,8 +24,8 @@
99  #include <unistd.h>
100  #include <fcntl.h>
101  #include <errno.h>
102 -#include <sys/stat.h>
103 -#include <sys/statfs.h>
104 +#include <sys/param.h>
105 +#include <sys/mount.h>
106  
107  
108  #define DVD_PAL_4x3    0
109 diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C
110 index f9571c9..d1197c3 100644
111 --- a/cinelerra-5.1/cinelerra/file.C
112 +++ b/cinelerra-5.1/cinelerra/file.C
113 @@ -1589,7 +1589,10 @@ int File::record_fd()
114  void File::get_exe_path(char *result, char *bnp)
115  {
116  // Get executable path, basename
117 -       int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
118 +       char exe_path[BCTEXTLEN];
119 +       sprintf(exe_path,"/proc/%d/file",getpid());
120 +       int len = readlink(exe_path, result, BCTEXTLEN-1);
121 +
122         if( len >= 0 ) {
123                 result[len] = 0;
124                 char *ptr = strrchr(result, '/');
125 diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C
126 index 87b8853..ad75d24 100644
127 --- a/cinelerra-5.1/cinelerra/indexfile.C
128 +++ b/cinelerra-5.1/cinelerra/indexfile.C
129 @@ -70,9 +70,7 @@
130  
131  #include <sys/types.h>
132  #include <sys/stat.h>
133 -#ifdef HAVE_ISOFS
134 -#include <linux/iso_fs.h>
135 -#endif
136 +#include <isofs/cd9660/iso.h>
137  
138  // check for isofs volume_id for dvd/cdrom
139  
140 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
141 index ee75006..071d8e7 100644
142 --- a/cinelerra-5.1/configure.ac
143 +++ b/cinelerra-5.1/configure.ac
144 @@ -18,8 +18,18 @@ CFG_CFLAGS+=" -Wno-unused-result"
145  CFG_CFLAGS+=" -Wno-stringop-overflow"
146  CFG_CFLAGS+=" -Wno-format-truncation"
147  CFG_CFLAGS+=" -Wno-format-overflow"
148 +CFG_CFLAGS+=" -Wno-unknown-warning-option"
149  CFG_CFLAGS+=" -Wno-parentheses"
150  CFG_CFLAGS+=" -Wno-stringop-truncation"
151 +CFG_CFLAGS+=" -Wno-gnu-designator"
152 +CFG_CFLAGS+=" -Wno-missing-braces"
153 +CFG_CFLAGS+=" -Wno-overloaded-virtual"
154 +CFG_CFLAGS+=" -Wno-self-assign-field"
155 +CFG_CFLAGS+=" -Wno-sometimes-uninitialized"
156 +CFG_CFLAGS+=" -Wno-tautological-pointer-compare"
157 +CFG_CFLAGS+=" -Wno-unused-function"
158 +CFG_CFLAGS+=" -Wno-unused-private-field"
159 +CFG_CFLAGS+=" -Wno-infinite-recursion"
160  CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
161  CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
162  CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
163 @@ -140,7 +150,7 @@ AC_SUBST(MAK_INSTALLS)
164  AC_SUBST(MAK_UNINSTALLS)
165  
166  if test "x$WANT_JOBS" = "xauto"; then
167 -  CPUS=`grep -c "^proc" /proc/cpuinfo`
168 +  CPUS=`sysctl -n hw.ncpu`
169    WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
170  fi
171  
172 @@ -1132,6 +1142,11 @@ if test "x$CFG_LDFLAGS" != "x" ; then
173    echo ""
174  fi
175  
176 +if test "x$BSD" != "x" ; then
177 +  echo "CFLAGS += -DNO_PRCTL"
178 +  echo "CFLAGS += -DNO_TID"
179 +  echo "CFLAGS += -DNO_GDB"
180 +fi
181  if test "x$CYGWIN" != "x" ; then
182    echo 'FF_PATH ?= /usr/local'
183    echo 'LDFLAGS += -L$(FF_PATH)/lib'
184 @@ -1147,11 +1162,6 @@ if test "x$CYGWIN" != "x" ; then
185  else
186    LDFLAGS+=" -z noexecstack"
187  fi
188 -if test "x$BSD" != "x" ; then
189 -  echo "CFLAGS += -DNO_PRCTL"
190 -  echo "CFLAGS += -DNO_TID"
191 -  echo "CFLAGS += -DNO_GDB"
192 -fi
193  
194  if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
195    X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
196 diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
197 index 8ee8800..9a17091 100644
198 --- a/cinelerra-5.1/db/tdb.h
199 +++ b/cinelerra-5.1/db/tdb.h
200 @@ -32,7 +32,7 @@ inline void operator delete[](void *t,size_t n) { free(t); }
201  #endif
202  
203  #define ZMEDIA
204 -#define ZFUTEX
205 +//#define ZFUTEX
206  #ifdef ZFUTEX
207  #include <unistd.h>
208  #include <endian.h>
209 diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
210 index 201c5a4..1c3822f 100644
211 --- a/cinelerra-5.1/guicast/Makefile
212 +++ b/cinelerra-5.1/guicast/Makefile
213 @@ -95,7 +95,7 @@ $(shell echo $(OBJS) > $(OBJDIR)/objs)
214  all: $(OUTPUT) $(UTILS)
215  
216  $(BCXFER):     bccmdl.py bcxfer.C bcxfer.h
217 -       python < ./bccmdl.py
218 +       python2.7 < ./bccmdl.py
219         +$(MAKE) -C xfer
220  
221  $(OUTPUT): $(OBJS) $(BCXFER)
222 diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h
223 index ce34ffc..0e38913 100644
224 --- a/cinelerra-5.1/guicast/bclistbox.h
225 +++ b/cinelerra-5.1/guicast/bclistbox.h
226 @@ -187,7 +187,9 @@ public:
227  
228  // take_focus - used by the suggestion box to keep it from taking focus from the
229  // textbox
230 -       int activate(int take_focus = 1);
231 +       int activate() {  return activate(1); }
232 +       int activate(int take_focus);
233 +
234         int activate(int x, int y, int w=-1, int h=-1);
235         int deactivate();
236         int is_active();
237 diff --git a/cinelerra-5.1/guicast/bcpan.h b/cinelerra-5.1/guicast/bcpan.h
238 index 40f5971..73d4758 100644
239 --- a/cinelerra-5.1/guicast/bcpan.h
240 +++ b/cinelerra-5.1/guicast/bcpan.h
241 @@ -93,7 +93,8 @@ public:
242                 int &stick_x,
243                 int &stick_y);
244         static int rdtoxy(int &x, int &y, int a, int virtual_r);
245 -       int activate(int popup_x = -1, int popup_y = -1);
246 +       int activate(int popup_x, int popup_y);
247 +       int activate() { return activate(-1,-1); }
248         int deactivate();
249         float* get_values();
250  
251 diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
252 index 1d52855..c8d93bd 100644
253 --- a/cinelerra-5.1/guicast/bcresources.C
254 +++ b/cinelerra-5.1/guicast/bcresources.C
255 @@ -39,6 +39,7 @@
256  #include <iconv.h>
257  #include <sys/ipc.h>
258  #include <sys/shm.h>
259 +#include <sys/sysctl.h>
260  #include <X11/extensions/XShm.h>
261  #include <fontconfig/fontconfig.h>
262  #include <fontconfig/fcfreetype.h>
263 @@ -298,23 +299,12 @@ int BC_Resources::machine_cpus = 1;
264  
265  int BC_Resources::get_machine_cpus()
266  {
267 -       int cpus = 1;
268 -       FILE *proc = fopen("/proc/cpuinfo", "r");
269 -       if( proc ) {
270 -               char string[BCTEXTLEN], *cp;
271 -               while(!feof(proc) && fgets(string, sizeof(string), proc) ) {
272 -                       if( !strncasecmp(string, "processor", 9) &&
273 -                           (cp = strchr(string, ':')) != 0 ) {
274 -                               int n = atol(cp+1) + 1;
275 -                               if( n > cpus ) cpus = n;
276 -                       }
277 -                       else if( !strncasecmp(string, "cpus detected", 13) &&
278 -                           (cp = strchr(string, ':')) != 0 )
279 -                               cpus = atol(cp+1);
280 -               }
281 -               fclose(proc);
282 -       }
283 -       return cpus;
284 +       int mib[2], ncpu;
285 +       size_t len = sizeof(ncpu);
286 +       mib[0] = CTL_HW;
287 +       mib[1] = HW_NCPU;
288 +       if( sysctl(mib, 2, &ncpu, &len, 0, 0) ) ncpu = 1;
289 +       return ncpu;
290  }
291  
292  void BC_Resources::new_vframes(int n, VFrame *vframes[], ...)
293 @@ -367,8 +357,8 @@ BC_Resources::BC_Resources(float x_scale, float y_scale)
294         BC_WindowBase::resources = this;
295         synchronous = 0;
296         vframe_shm = 0;
297 -       use_shm = -1;
298 -       shm_reply = 1;
299 +       use_shm = 0;
300 +       shm_reply = 0;
301  
302         if( x_scale <= 0 ) x_scale = 1;
303         if( y_scale <= 0 ) y_scale = x_scale;
304 diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
305 index ffc8a1c..b83b328 100644
306 --- a/cinelerra-5.1/guicast/bcsignals.C
307 +++ b/cinelerra-5.1/guicast/bcsignals.C
308 @@ -395,70 +395,72 @@ const char* BC_Signals::sig_to_str(int number)
309  #include <sys/wait.h>
310  #include "thread.h"
311  
312 +#define SC_(r)mc_##r
313 +
314  #if __i386__
315 -#define IP eip
316 -#define sigregs_t sigcontext
317 +#define IP SC_(eip)
318 +#define sigregs_t mcontext_t
319  
320  static void reg_dump(FILE *fp,sigregs_t *rp)
321  {
322         fprintf(fp,"REGS:\n");
323 -       fprintf(fp,"  gs: %04x:%04x\n", rp->gs,rp->__gsh);
324 -       fprintf(fp,"  fs: %04x:%04x\n", rp->fs,rp->__fsh);
325 -       fprintf(fp,"  es: %04x:%04x\n", rp->es,rp->__esh);
326 -       fprintf(fp,"  ds: %04x:%04x\n", rp->ds,rp->__dsh);
327 -       fprintf(fp," edi: %14p %d\n", (void*)rp->edi,rp->edi);
328 -       fprintf(fp," esi: %14p %d\n", (void*)rp->esi,rp->esi);
329 -       fprintf(fp," ebp: %14p %d\n", (void*)rp->ebp,rp->ebp);
330 -       fprintf(fp," esp: %14p %d\n", (void*)rp->esp,rp->esp);
331 -       fprintf(fp," ebx: %14p %d\n", (void*)rp->ebx,rp->ebx);
332 -       fprintf(fp," edx: %14p %d\n", (void*)rp->edx,rp->edx);
333 -       fprintf(fp," ecx: %14p %d\n", (void*)rp->ecx,rp->ecx);
334 -       fprintf(fp," eax: %14p %d\n", (void*)rp->eax,rp->eax);
335 -       fprintf(fp," trapno: %14p %d\n", (void*)rp->trapno,rp->trapno);
336 -       fprintf(fp," err: %14p %d\n", (void*)rp->err,rp->err);
337 -       fprintf(fp," eip: %14p %d\n", (void*)rp->eip,rp->eip);
338 -       fprintf(fp," cs: %04xd : %04x\n", rp->cs,rp->__csh);
339 -       fprintf(fp," eflags: %14p %d\n", (void*)rp->eflags,rp->eflags);
340 -       fprintf(fp," esp_at_signal: %p %d\n", (void*)rp->esp_at_signal,rp->esp_at_signal);
341 -       fprintf(fp," ss: %04xd : %04x\n", rp->ss,rp->__ssh);
342 -       fprintf(fp," oldmask: %14p %d\n", (void*)rp->oldmask,rp->oldmask);
343 -       fprintf(fp," cr2: %14p %d\n", (void*)rp->cr2,rp->cr2);
344 +       fprintf(fp,"  gs: %04x:%04x\n", rp->mc_gs,rp->mc_gs);
345 +       fprintf(fp,"  fs: %04x:%04x\n", rp->mc_fs,rp->mc_fs);
346 +       fprintf(fp,"  es: %04x:%04x\n", rp->mc_es,rp->mc_es);
347 +       fprintf(fp,"  ds: %04x:%04x\n", rp->mc_ds,rp->mc_ds);
348 +       fprintf(fp," edi: %14p %d\n", (void*)rp->mc_edi,rp->mc_edi);
349 +       fprintf(fp," esi: %14p %d\n", (void*)rp->mc_esi,rp->mc_esi);
350 +       fprintf(fp," ebp: %14p %d\n", (void*)rp->mc_ebp,rp->mc_ebp);
351 +       fprintf(fp," esp: %14p %d\n", (void*)rp->mc_esp,rp->mc_esp);
352 +       fprintf(fp," ebx: %14p %d\n", (void*)rp->mc_ebx,rp->mc_ebx);
353 +       fprintf(fp," edx: %14p %d\n", (void*)rp->mc_edx,rp->mc_edx);
354 +       fprintf(fp," ecx: %14p %d\n", (void*)rp->mc_ecx,rp->mc_ecx);
355 +       fprintf(fp," eax: %14p %d\n", (void*)rp->mc_eax,rp->mc_eax);
356 +       fprintf(fp," trapno: %14p %d\n", (void*)rp->mc_trapno,rp->mc_trapno);
357 +       fprintf(fp," err: %14p %d\n", (void*)rp->mc_err,rp->mc_err);
358 +       fprintf(fp," eip: %14p %d\n", (void*)rp->mc_eip,rp->mc_eip);
359 +       fprintf(fp," cs: %04x\n", (unsigned)rp->mc_cs);
360 +       fprintf(fp," eflags: %14p %d\n", (void*)rp->mc_eflags,rp->mc_eflags);
361 +       fprintf(fp," esp_at_signal: %p %d\n", (void*)rp->mc_esp_at_signal,rp->mc_esp_at_signal);
362 +       fprintf(fp," ss: %04xd : %04x\n", rp->mc_ss,rp->mc_ss);
363 +//     fprintf(fp," oldmask: %14p %d\n", (void*)rp->mc_oldmask,rp->mc_oldmask);
364 +//     fprintf(fp," cr2: %14p %d\n", (void*)rp->mc_cr2,rp->mc_cr2);
365         fprintf(fp,"\n");
366  }
367  #endif
368  
369  #if __x86_64__
370 -#define IP rip
371 -#define sigregs_t sigcontext
372 +#define IP SC_(rip)
373 +#define sigregs_t mcontext_t
374  
375  static void reg_dump(FILE *fp,sigregs_t *rp)
376  {
377         fprintf(fp,"REGS:\n");
378 -       fprintf(fp,"  r8: %20p %jd\n", (void*)rp->r8,rp->r8);
379 -       fprintf(fp,"  r9: %20p %jd\n", (void*)rp->r9,rp->r9);
380 -       fprintf(fp," r10: %20p %jd\n", (void*)rp->r10,rp->r10);
381 -       fprintf(fp," r11: %20p %jd\n", (void*)rp->r11,rp->r11);
382 -       fprintf(fp," r12: %20p %jd\n", (void*)rp->r12,rp->r12);
383 -       fprintf(fp," r13: %20p %jd\n", (void*)rp->r13,rp->r13);
384 -       fprintf(fp," r14: %20p %jd\n", (void*)rp->r14,rp->r14);
385 -       fprintf(fp," r15: %20p %jd\n", (void*)rp->r15,rp->r15);
386 -       fprintf(fp," rdi: %20p %jd\n", (void*)rp->rdi,rp->rdi);
387 -       fprintf(fp," rsi: %20p %jd\n", (void*)rp->rsi,rp->rsi);
388 -       fprintf(fp," rbp: %20p %jd\n", (void*)rp->rbp,rp->rbp);
389 -       fprintf(fp," rbx: %20p %jd\n", (void*)rp->rbx,rp->rbx);
390 -       fprintf(fp," rdx: %20p %jd\n", (void*)rp->rdx,rp->rdx);
391 -       fprintf(fp," rax: %20p %jd\n", (void*)rp->rax,rp->rax);
392 -       fprintf(fp," rcx: %20p %jd\n", (void*)rp->rcx,rp->rcx);
393 -       fprintf(fp," rsp: %20p %jd\n", (void*)rp->rsp,rp->rsp);
394 -       fprintf(fp," rip: %20p %jd\n", (void*)rp->rip,rp->rip);
395 -       fprintf(fp," eflags: %14p %jd\n", (void*)rp->eflags,rp->eflags);
396 -       fprintf(fp,"  cs: %04x\n", rp->cs);
397 -       fprintf(fp,"  gs: %04x\n", rp->gs);
398 -       fprintf(fp,"  fs: %04x\n", rp->fs);
399 -       fprintf(fp," err: %20p %jd\n", (void*)rp->err,rp->err);
400 -       fprintf(fp," trapno: %20p %jd\n", (void*)rp->trapno,rp->trapno);
401 -       fprintf(fp," oldmask: %20p %jd\n", (void*)rp->oldmask,rp->oldmask);
402 -       fprintf(fp," cr2: %20p %jd\n", (void*)rp->cr2,rp->cr2);
403 +       fprintf(fp,"  r8: %20p %jd\n", (void*)rp->mc_r8,rp->mc_r8);
404 +       fprintf(fp,"  r9: %20p %jd\n", (void*)rp->mc_r9,rp->mc_r9);
405 +       fprintf(fp," r10: %20p %jd\n", (void*)rp->mc_r10,rp->mc_r10);
406 +       fprintf(fp," r11: %20p %jd\n", (void*)rp->mc_r11,rp->mc_r11);
407 +       fprintf(fp," r12: %20p %jd\n", (void*)rp->mc_r12,rp->mc_r12);
408 +       fprintf(fp," r13: %20p %jd\n", (void*)rp->mc_r13,rp->mc_r13);
409 +       fprintf(fp," r14: %20p %jd\n", (void*)rp->mc_r14,rp->mc_r14);
410 +       fprintf(fp," r15: %20p %jd\n", (void*)rp->mc_r15,rp->mc_r15);
411 +       fprintf(fp," rdi: %20p %jd\n", (void*)rp->mc_rdi,rp->mc_rdi);
412 +       fprintf(fp," rsi: %20p %jd\n", (void*)rp->mc_rsi,rp->mc_rsi);
413 +       fprintf(fp," rbp: %20p %jd\n", (void*)rp->mc_rbp,rp->mc_rbp);
414 +       fprintf(fp," rbx: %20p %jd\n", (void*)rp->mc_rbx,rp->mc_rbx);
415 +       fprintf(fp," rdx: %20p %jd\n", (void*)rp->mc_rdx,rp->mc_rdx);
416 +       fprintf(fp," rax: %20p %jd\n", (void*)rp->mc_rax,rp->mc_rax);
417 +       fprintf(fp," rcx: %20p %jd\n", (void*)rp->mc_rcx,rp->mc_rcx);
418 +       fprintf(fp," rsp: %20p %jd\n", (void*)rp->mc_rsp,rp->mc_rsp);
419 +       fprintf(fp," rip: %20p %jd\n", (void*)rp->mc_rip,rp->mc_rip);
420 +       fprintf(fp," eflags: %14p %u\n", (void*)((unsigned long)rp->mc_flags),rp->mc_flags);
421 +       fprintf(fp,"  cs: %04x\n", (unsigned)rp->mc_cs);
422 +       fprintf(fp,"  gs: %04x\n", (unsigned)rp->mc_gs);
423 +       fprintf(fp,"  fs: %04x\n", (unsigned)rp->mc_fs);
424 +       fprintf(fp," err: %20p %jd\n", (void*)rp->mc_err,rp->mc_err);
425 +       fprintf(fp," trapno: %20p %d\n", (void*)((unsigned long)rp->mc_trapno),rp->mc_trapno);
426 +//     fprintf(fp," oldmask: %20p %jd\n", (void*)rp->mc_oldmask,rp->mc_oldmask);
427 +//     fprintf(fp," cr2: %20p %jd\n", (void*)rp->mc_cr2,rp->mc_cr2);
428         fprintf(fp,"\n");
429  }
430  
431 @@ -492,7 +494,7 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
432         void *ip = 0;
433  #ifndef NO_CTX
434         ucontext_t *uc = (ucontext_t *)sc;
435 -       struct sigregs_t *c = (struct sigregs_t *)&uc->uc_mcontext;
436 +       sigregs_t *c = (sigregs_t *)&uc->uc_mcontext;
437         ip = (void *)c->IP;
438  #endif
439         fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
440 diff --git a/cinelerra-5.1/guicast/bctrace.C b/cinelerra-5.1/guicast/bctrace.C
441 index 7e45392..2d08b46 100644
442 --- a/cinelerra-5.1/guicast/bctrace.C
443 +++ b/cinelerra-5.1/guicast/bctrace.C
444 @@ -309,7 +309,7 @@ void BC_Trace::dump_traces(FILE *fp)
445         }
446  }
447  
448 -void trace_info::set_owner() { owner = pthread_self(); }
449 +void trace_info::set_owner() { owner = (unsigned long)pthread_self(); }
450  void trace_info::unset_owner() { owner = 0; }
451  
452  void BC_Trace::dump_locks(FILE *fp)
453 @@ -322,7 +322,7 @@ void BC_Trace::dump_locks(FILE *fp)
454                 fprintf(fp,"    %p %s, %s %p%s",
455                         p->info, p->title, p->loc,
456                         (void*)p->tid, p->is_owner ? " *" : "");
457 -               if( p->info->owner && p->info->owner != p->tid )
458 +               if( p->info->owner && p->info->owner != (unsigned long)p->tid )
459                         fprintf(fp," %p", (void*)p->info->owner);
460                 fprintf(fp,"\n");
461         }
462 diff --git a/cinelerra-5.1/guicast/filesystem.h b/cinelerra-5.1/guicast/filesystem.h
463 index c976135..5613702 100644
464 --- a/cinelerra-5.1/guicast/filesystem.h
465 +++ b/cinelerra-5.1/guicast/filesystem.h
466 @@ -26,6 +26,9 @@
467  #include "bcwindowbase.inc"
468  #include "sizes.h"
469  
470 +#define dirent64 dirent
471 +#define readdir64 readdir
472 +
473  class FileItem
474  {
475  public:
476 diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
477 index 50b52a4..321ab4f 100644
478 --- a/cinelerra-5.1/guicast/thread.C
479 +++ b/cinelerra-5.1/guicast/thread.C
480 @@ -55,13 +55,6 @@ void* Thread::entrypoint(void *parameters)
481         pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
482         thread->cancel_enabled = false;
483  
484 -// Set realtime here since it doesn't work in start
485 -       if( thread->realtime && getuid() == 0 ) {
486 -               struct sched_param param = { sched_priority : 1 };
487 -               if(pthread_setschedparam(thread->tid, SCHED_RR, &param) < 0)
488 -                       perror("Thread::entrypoint pthread_attr_setschedpolicy");
489 -       }
490 -
491         thread->run();
492         thread->finished = true;
493         if( !thread->synchronous ) {
494 diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
495 index e63682d..072653b 100644
496 --- a/cinelerra-5.1/plugins/Makefile
497 +++ b/cinelerra-5.1/plugins/Makefile
498 @@ -36,7 +36,6 @@ DIRS = $(OPENCV_OBJS) \
499         brightness \
500         burn \
501         C41 \
502 -       cdripper \
503         chorus \
504         chromakey \
505         chromakeyhsv \
506 @@ -177,6 +176,8 @@ DIRS = $(OPENCV_OBJS) \
507  #      denoisemjpeg \
508  # duplicate
509  #      vocoder \
510 +# not in bsd
511 +#      cdripper \
512  
513  PLUGIN_DIR = $(BINDIR)/plugins
514  DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
515 diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C
516 index 0fc6669..68197ab 100644
517 --- a/cinelerra-5.1/plugins/titler/titler.C
518 +++ b/cinelerra-5.1/plugins/titler/titler.C
519 @@ -57,8 +57,7 @@
520  #include <stdint.h>
521  #include <stdio.h>
522  #include <string.h>
523 -#include <endian.h>
524 -#include <byteswap.h>
525 +#include <sys/endian.h>
526  #include <iconv.h>
527  #include <sys/stat.h>
528  #include <fontconfig/fontconfig.h>