diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-11 22:38:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-11 22:53:12 +0200 |
commit | 62a1e0035a1438883510f47e8d9af0df5d3e9b53 (patch) | |
tree | 50b462b02a2a312c53823ee0bb41435e582ff62f /libavformat/mlvdec.c | |
parent | a228f7d5e5eb689a67b3edcebeeaf540e18a68ce (diff) | |
download | ffmpeg-62a1e0035a1438883510f47e8d9af0df5d3e9b53.tar.gz |
avformat/mlvdec: Use AVFormatContext->open_cb()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mlvdec.c')
-rw-r--r-- | libavformat/mlvdec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c index 9d821bb7b3..aa1ba60d37 100644 --- a/libavformat/mlvdec.c +++ b/libavformat/mlvdec.c @@ -28,6 +28,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/rational.h" #include "avformat.h" +#include "avio_internal.h" #include "internal.h" #include "riff.h" @@ -331,11 +332,17 @@ static int read_header(AVFormatContext *avctx) if (strlen(avctx->filename) > 2) { int i; char *filename = av_strdup(avctx->filename); + AVOpenCallback open_func = avctx->open_cb; + if (!filename) return AVERROR(ENOMEM); + + if (!open_func) + open_func = ffio_open2_wrapper; + for (i = 0; i < 100; i++) { snprintf(filename + strlen(filename) - 2, 3, "%02d", i); - if (avio_open2(&mlv->pb[i], filename, AVIO_FLAG_READ, &avctx->interrupt_callback, NULL) < 0) + if (open_func(avctx, &mlv->pb[i], filename, AVIO_FLAG_READ, &avctx->interrupt_callback, NULL) < 0) break; if (check_file_header(mlv->pb[i], guid) < 0) { av_log(avctx, AV_LOG_WARNING, "ignoring %s; bad format or guid mismatch\n", filename); |