av_open/close_input_file changed to avformat_open/close_input

---
 fileffmpeg.C |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)
---
diff -uprN a/cinelerra/fileffmpeg.C b/cinelerra/fileffmpeg.C
--- a/cinelerra/fileffmpeg.C    2013-01-16 02:38:40.000000000 +0530
+++ b/cinelerra/fileffmpeg.C    2013-01-16 02:38:19.000000000 +0530
@@ -108,14 +108,22 @@ int FileFFMPEG::check_sig(Asset *asset)
   av_register_all();

   AVFormatContext *ffmpeg_file_context = 0;
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
   AVFormatParameters params;
-  bzero(&params, sizeof(params));
+  memset(&params, 0, sizeof(params));
   int result = av_open_input_file(
                                   &ffmpeg_file_context,
                                   asset->path,
                                   0,
                                   0,
                                   &params);
+#else
+  int result = avformat_open_input(
+                                  &ffmpeg_file_context,
+                                  asset->path,
+                                  NULL,
+                                  NULL);
+#endif

   if(result >= 0)
     {
@@ -124,7 +132,11 @@ int FileFFMPEG::check_sig(Asset *asset)

       if(result >= 0)
         {
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
           av_close_input_file(ffmpeg_file_context);
+#else
+          avformat_close_input(&ffmpeg_file_context);
+#endif
           ffmpeg_lock->unlock();
           return 1;
         }
@@ -142,8 +154,10 @@ int FileFFMPEG::check_sig(Asset *asset)
 int FileFFMPEG::open_file(int rd, int wr)
 {
   int result = 0;
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
   AVFormatParameters params;
-  bzero(&params, sizeof(params));
+  memset(&params, 0, sizeof(params));
+#endif

   ffmpeg_lock->lock("FileFFMPEG::open_file");
 #if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
@@ -153,12 +167,20 @@ int FileFFMPEG::open_file(int rd, int wr
   av_register_all();

   if(rd){
+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
       result = av_open_input_file(
                                   (AVFormatContext**)&ffmpeg_file_context,
                                   asset->path,
                                   0,
                                   0,
                                   &params);
+#else
+      result = avformat_open_input(
+                             (AVFormatContext**)&ffmpeg_file_context,
+                              asset->path,
+                              NULL,
+                              NULL);
+#endif

       if(result >= 0)
         {
@@ -309,7 +331,11 @@ int FileFFMPEG::close_file()
       }
     }

+#if LIBAVCODEC_VERSION_INT < ((53<<16)+(35<<8)+0)
     av_close_input_file((AVFormatContext*)ffmpeg_file_context);
+#else
+    avformat_close_input((AVFormatContext**)&ffmpeg_file_context);
+#endif
   }
   ffmpeg_file_context = 0;
   reset();
_______________________________________________
Cinelerra mailing list
[email protected]
https://lists.skolelinux.org/listinfo/cinelerra

Reply via email to