[FFmpeg-devel] [PATCH 2/2] avformat/options: Simplify loglevel initialization in io_open_default()

Michael Niedermayer michael at niedermayer.cc
Sun Jun 4 02:38:03 EEST 2017


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/options.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavformat/options.c b/libavformat/options.c
index d6d589a0b0..16e3886e4b 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -102,14 +102,11 @@ static const AVClass av_format_context_class = {
 static int io_open_default(AVFormatContext *s, AVIOContext **pb,
                            const char *url, int flags, AVDictionary **options)
 {
-    int loglevel;
+    int loglevel = AV_LOG_INFO;
 
     if (!strcmp(url, s->filename) ||
-        !strcmp(s->iformat ? s->iformat->name : s->oformat->name, "image2")
-    ) {
+        !strcmp(s->iformat ? s->iformat->name : s->oformat->name, "image2"))
         loglevel = AV_LOG_DEBUG;
-    } else
-        loglevel = AV_LOG_INFO;
 
     av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading");
 
-- 
2.13.0



More information about the ffmpeg-devel mailing list