diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-10 14:40:32 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-10 14:42:41 +0000 |
commit | bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce (patch) | |
tree | 7011642746984633573c9a2d993d58dfd12ee44b /libavformat/mlvdec.c | |
parent | d94b11a721385aa406187da8f49380f29be0fa7e (diff) | |
parent | 9f61abc8111c7c43f49ca012e957a108b9cc7610 (diff) | |
download | ffmpeg-bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce.tar.gz |
Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'
This also deprecates our old duplicated callbacks.
* commit '9f61abc8111c7c43f49ca012e957a108b9cc7610':
lavf: allow custom IO for all files
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/mlvdec.c')
-rw-r--r-- | libavformat/mlvdec.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c index c003eab64e..288b2a1010 100644 --- a/libavformat/mlvdec.c +++ b/libavformat/mlvdec.c @@ -344,28 +344,24 @@ 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 (open_func(avctx, &mlv->pb[i], filename, AVIO_FLAG_READ, &avctx->interrupt_callback, NULL) < 0) + if (avctx->io_open(avctx, &mlv->pb[i], filename, AVIO_FLAG_READ, 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); - avio_closep(&mlv->pb[i]); + ff_format_io_close(avctx, &mlv->pb[i]); continue; } av_log(avctx, AV_LOG_INFO, "scanning %s\n", filename); ret = scan_file(avctx, vst, ast, i); if (ret < 0) { av_log(avctx, AV_LOG_WARNING, "ignoring %s; %s\n", filename, av_err2str(ret)); - avio_closep(&mlv->pb[i]); + ff_format_io_close(avctx, &mlv->pb[i]); continue; } } @@ -466,7 +462,7 @@ static int read_close(AVFormatContext *s) int i; for (i = 0; i < 100; i++) if (mlv->pb[i]) - avio_closep(&mlv->pb[i]); + ff_format_io_close(s, &mlv->pb[i]); return 0; } |