[FFmpeg-devel] [PATCH] avformat/img2dec: Use AVOpenCallback

Michael Niedermayer michaelni at gmx.at
Wed Jan 20 02:35:56 CET 2016


From: Michael Niedermayer <michael at niedermayer.cc>

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/img2dec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index db4b4b7..1039cce 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -370,6 +370,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 */
@@ -396,7 +400,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
                 !s->loop &&
                 !s->split_planes) {
                 f[i] = s1->pb;
-            } else if (avio_open2(&f[i], filename, AVIO_FLAG_READ,
+            } else if (open_func(s1, &f[i], filename, AVIO_FLAG_READ,
                            &s1->interrupt_callback, NULL) < 0) {
                 if (i >= 1)
                     break;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list