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

Submitted by Michael Niedermayer on June 3, 2017, 11:38 p.m.

Details

Message ID 20170603233803.17416-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer June 3, 2017, 11:38 p.m.
This simplifies the code and reduces clutter.

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

Patch hide | download patch | download mbox

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