diff mbox series

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

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

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
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/cmdutils.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index f0f2b4fde4..855a78e15f 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1854,9 +1854,10 @@  static void show_help_codec(const char *name, int encoder)
 
 static void show_help_demuxer(const char *name)
 {
-    const AVInputFormat *fmt = av_find_input_format(name);
+    const AVInputFormat *fmt;
 
-    if (!fmt) {
+    if (!(fmt = av_find_input_format(name)) &&
+        !(fmt = av_demuxer_find_by_ext(name))) {
         av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
         return;
     }