diff mbox series

[FFmpeg-devel,4/6] fftools/ffprobe: search for demuxer by extension as well

Message ID 20200131142608.42729-4-ffmpeg@gyani.pro
State New
Headers show
Series [FFmpeg-devel,1/6] avformat/format: add av_demuxer_find_by_ext | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Gyan Doshi Jan. 31, 2020, 2:26 p.m. UTC
Identifies demuxer based on extension if short name search fails.
---
 fftools/ffprobe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index b619c1f34e..a2886ec976 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3166,8 +3166,8 @@  static void ffprobe_show_pixel_formats(WriterContext *w)
 
 static int opt_format(void *optctx, const char *opt, const char *arg)
 {
-    iformat = av_find_input_format(arg);
-    if (!iformat) {
+    if (!(iformat = av_find_input_format(arg)) &&
+        !(iformat = av_demuxer_find_by_ext(arg))) {
         av_log(NULL, AV_LOG_ERROR, "Unknown input format: %s\n", arg);
         return AVERROR(EINVAL);
     }