Sfoglia il codice sorgente

(untested) fix for ffmpeg versions 52.68.0 and above

rdb 15 anni fa
parent
commit
a1093099c8
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      panda/src/movies/ffmpegVirtualFile.cxx

+ 9 - 0
panda/src/movies/ffmpegVirtualFile.cxx

@@ -32,7 +32,12 @@ extern "C" {
 extern "C" {
 extern "C" {
   static int       pandavfs_open(URLContext *h, const char *filename, int flags);
   static int       pandavfs_open(URLContext *h, const char *filename, int flags);
   static int       pandavfs_read(URLContext *h, unsigned char *buf, int size);
   static int       pandavfs_read(URLContext *h, unsigned char *buf, int size);
+// This change happened a few days before 52.68.0
+#if LIBAVFORMAT_VERSION_INT < 3425280
+  static int       pandavfs_write(URLContext *h, const unsigned char *buf, int size);
+#else
   static int       pandavfs_write(URLContext *h, unsigned char *buf, int size);
   static int       pandavfs_write(URLContext *h, unsigned char *buf, int size);
+#endif
   static PN_int64  pandavfs_seek(URLContext *h, PN_int64 pos, int whence);
   static PN_int64  pandavfs_seek(URLContext *h, PN_int64 pos, int whence);
   static int       pandavfs_close(URLContext *h);
   static int       pandavfs_close(URLContext *h);
 }
 }
@@ -88,7 +93,11 @@ pandavfs_read(URLContext *h, unsigned char *buf, int size) {
 //  Description: A hook to write a panda VFS file.
 //  Description: A hook to write a panda VFS file.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 static int
 static int
+#if LIBAVFORMAT_VERSION_INT < 3425280
 pandavfs_write(URLContext *h, unsigned char *buf, int size) {
 pandavfs_write(URLContext *h, unsigned char *buf, int size) {
+#else
+pandavfs_write(URLContext *h, const unsigned char *buf, int size) {
+#endif
   movies_cat.error() << "ffmpeg is trying to write to the VFS.\n";
   movies_cat.error() << "ffmpeg is trying to write to the VFS.\n";
   return -1;
   return -1;
 }
 }