Browse Source

compatibility with older ffmpeg versions

rdb 14 years ago
parent
commit
5cdc46bf0b
1 changed files with 8 additions and 1 deletions
  1. 8 1
      panda/src/movies/ffmpegVirtualFile.cxx

+ 8 - 1
panda/src/movies/ffmpegVirtualFile.cxx

@@ -201,16 +201,23 @@ register_protocol() {
 void FfmpegVirtualFile::
 void FfmpegVirtualFile::
 log_callback(void *ptr, int level, const char *fmt, va_list v1) {
 log_callback(void *ptr, int level, const char *fmt, va_list v1) {
   NotifySeverity severity;
   NotifySeverity severity;
+#ifdef AV_LOG_PANIC
   if (level <= AV_LOG_PANIC) {
   if (level <= AV_LOG_PANIC) {
     severity = NS_fatal;
     severity = NS_fatal;
-  } else if (level <= AV_LOG_ERROR) {
+  } else
+#endif
+  if (level <= AV_LOG_ERROR) {
     severity = NS_error;
     severity = NS_error;
+#ifdef AV_LOG_WARNING
   } else if (level <= AV_LOG_WARNING) {
   } else if (level <= AV_LOG_WARNING) {
     severity = NS_warning;
     severity = NS_warning;
+#endif
   } else if (level <= AV_LOG_INFO) {
   } else if (level <= AV_LOG_INFO) {
     severity = NS_info;
     severity = NS_info;
+#ifdef AV_LOG_VERBOSE
   } else if (level <= AV_LOG_VERBOSE) {
   } else if (level <= AV_LOG_VERBOSE) {
     severity = NS_debug;
     severity = NS_debug;
+#endif
   } else /* level <= AV_LOG_DEBUG */ {
   } else /* level <= AV_LOG_DEBUG */ {
     severity = NS_spam;
     severity = NS_spam;
   }
   }