[FFmpeg-cvslog] avformat/img2dec: Use AVOpenCallback

Michael Niedermayer git at videolan.org
Thu Jan 28 16:11:45 CET 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 20 02:35:56 2016 +0100| [8ed4b446571aa591f77a87411c8a8728de54c971] | committer: Michael Niedermayer

avformat/img2dec: Use AVOpenCallback

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b750b67d13696fdbcd62ce7238eb2826f2be4686)

Conflicts:

	libavformat/img2dec.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8ed4b446571aa591f77a87411c8a8728de54c971
---

 libavformat/img2dec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index d6cfe80..2bff91b 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -376,6 +376,10 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
     int size[3]           = { 0 }, ret[3] = { 0 };
     AVIOContext *f[3]     = { NULL };
     AVCodecContext *codec = s1->streams[0]->codec;
+    AVOpenCallback open_func = s1->open_cb;
+
+    if (!open_func)
+        open_func = ffio_open2_wrapper;
 
     if (!s->is_pipe) {
         /* loop over input */
@@ -397,7 +401,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
             return AVERROR(EIO);
         }
         for (i = 0; i < 3; i++) {
-            if (avio_open2(&f[i], filename, AVIO_FLAG_READ,
+            if (open_func(s1, &f[i], filename, AVIO_FLAG_READ,
                            &s1->interrupt_callback, NULL) < 0) {
                 if (i >= 1)
                     break;



More information about the ffmpeg-cvslog mailing list