[FFmpeg-devel] [PATCH 1/2] avformat/options: Remove one special case in io_open_default()

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


This simplifies the code and reduces clutter.

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

diff --git a/libavformat/options.c b/libavformat/options.c
index 9371c72667..d6d589a0b0 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -105,8 +105,7 @@ static int io_open_default(AVFormatContext *s, AVIOContext **pb,
     int loglevel;
 
     if (!strcmp(url, s->filename) ||
-        s->iformat && !strcmp(s->iformat->name, "image2") ||
-        s->oformat && !strcmp(s->oformat->name, "image2")
+        !strcmp(s->iformat ? s->iformat->name : s->oformat->name, "image2")
     ) {
         loglevel = AV_LOG_DEBUG;
     } else
-- 
2.13.0



More information about the ffmpeg-devel mailing list