add configure without-thirdparty, without-libzmpeg, without-commercial
[goodguy/history.git] / cinelerra-5.1 / libzmpeg3 / libzmpeg3.h
index 48414cdc5898724bdc41f186724297f77e7c985d..430ebb4d79ed4b40cc80d415b72e7ecc797d0d8e 100644 (file)
@@ -1,13 +1,17 @@
 #ifndef LIBMPEG3_H
 #define LIBMPEG3_H
+#ifdef HAVE_LIBZMPEG
 
 /* for quicktime build */
 #define MAXFRAMESAMPLES 65536
 #define ZDVB
 #define USE_FUTEX
 
-#include <stdio.h>
+#ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
+#endif
+
+#include <stdio.h>
 #include <stdint.h>
 
 typedef int (*zthumbnail_cb)(void *p, int trk);
@@ -37,7 +41,7 @@ typedef int (*zcc_text_cb)(int sid, int id, int sfrm, int efrm, const char *txt)
 #endif
 
 extern "C" {
-#include "a52dec-0.7.3/include/a52.h"
+#include "a52.h"
 }
 
 #define ZMPEG3_MAJOR   2
@@ -87,26 +91,11 @@ extern "C" {
 #define zlikely(x)   __builtin_expect((x),1)
 #define zunlikely(x) __builtin_expect((x),0)
 
-#if defined(__x86_64__)
-#define _LD "%ld"
-#define _LDv(v) "%" #v "ld"
-#define _LU "%lu"
-#define _LUv(v) "%" #v "lu"
-#define _LX "%lx"
-#define _LXv(v) "%" #v "lx"
-#else
-#define _LD "%lld"
-#define _LDv(v) "%" #v "lld"
-#define _LU "%llu"
-#define _LUv(v) "%" #v "llu"
-#define _LX "%llx"
-#define _LXv(v) "%" #v "llx"
-#endif
 #define bcd(n) ((((n)>>4)&0x0f)*10+((n)&0x0f))
 
 #define new_memset(s) \
   void *operator new(size_t n) { \
-    void *t = (void*) new char[n]; \
+    void * volatile t = (void*) new char[n]; \
     memset(t,s,n); \
     return t; \
   } \
@@ -114,7 +103,7 @@ extern "C" {
     delete[](char*)t; \
   } \
   void *operator new[](size_t n) { \
-    void *t = (void*) new char[n]; \
+    void * volatile t = (void*) new char[n]; \
     memset(t,s,n); \
     return t; \
   } \
@@ -2858,9 +2847,9 @@ public:
   }
 
   static inline void complete_path(char *full_path, char *path) {
-    char dir[zmpeg3_t::STRLEN];
+    char dir[STRLEN];
     if( path[0] != '/' && getcwd(dir, sizeof(dir)) )
-      sprintf(full_path, "%s/%s", dir, path);
+      snprintf(full_path, STRLEN, "%s/%s", dir, path);
     else
       strcpy(full_path, path);
   }
@@ -2887,7 +2876,7 @@ public:
   }
 
   static inline void joinpath(char *path, char *dir, char *filename) {
-    sprintf(path, "%s/%s", dir, filename);
+    snprintf(path, STRLEN, "%s/%s", dir, filename);
   }
 
   static inline int64_t path_total_bytes(char *path) {
@@ -3104,3 +3093,4 @@ int mpeg3_dvb_get_system_time(mpeg3_t *zsrc, int64_t *tm);
 }
 #endif
 #endif
+#endif