1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avformat/img2dec: Use AVOpenCallback

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

Conflicts:

	libavformat/img2dec.c
This commit is contained in:
Michael Niedermayer 2016-01-20 02:35:56 +01:00
parent 3cd17b9b5c
commit 8c2f006d10

View File

@ -376,6 +376,10 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
int size[3] = { 0 }, ret[3] = { 0 }; int size[3] = { 0 }, ret[3] = { 0 };
AVIOContext *f[3] = { NULL }; AVIOContext *f[3] = { NULL };
AVCodecContext *codec = s1->streams[0]->codec; AVCodecContext *codec = s1->streams[0]->codec;
AVOpenCallback open_func = s1->open_cb;
if (!open_func)
open_func = ffio_open2_wrapper;
if (!s->is_pipe) { if (!s->is_pipe) {
/* loop over input */ /* loop over input */
@ -397,7 +401,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
return AVERROR(EIO); return AVERROR(EIO);
} }
for (i = 0; i < 3; i++) { 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) { &s1->interrupt_callback, NULL) < 0) {
if (i >= 1) if (i >= 1)
break; break;