avformat/mlvdec: Simplify code by using avio_closep()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Jan 2015 19:10:47 +0000 (20:10 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Jan 2015 19:19:20 +0000 (20:19 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mlvdec.c

index 06ea7b3..93d54e0 100644 (file)
@@ -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;
             }
         }