summaryrefslogtreecommitdiff
path: root/libavformat/mlvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-08 20:10:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-08 20:19:20 +0100
commitedeaf6f3a4d7983f3b86465920c7d425dd290362 (patch)
treea57e2c796b8e5e1f20ca72e77c934940be6312af /libavformat/mlvdec.c
parent07e4ed5637f5484cac4f5af2b890a8720b39e0b7 (diff)
avformat/mlvdec: Simplify code by using avio_closep()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mlvdec.c')
-rw-r--r--libavformat/mlvdec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
index 06ea7b3ea5..93d54e01e8 100644
--- a/libavformat/mlvdec.c
+++ b/libavformat/mlvdec.c
@@ -342,16 +342,14 @@ static int read_header(AVFormatContext *avctx)
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_close(mlv->pb[i]);
- mlv->pb[i] = NULL;
+ avio_closep(&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_close(mlv->pb[i]);
- mlv->pb[i] = NULL;
+ avio_closep(&mlv->pb[i]);
continue;
}
}