diff mbox series

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

Message ID 20200131142608.42729-5-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/ffplay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index fee0619f7c..4b5f46949c 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3477,8 +3477,8 @@  static int opt_height(void *optctx, const char *opt, const char *arg)
 
 static int opt_format(void *optctx, const char *opt, const char *arg)
 {
-    file_iformat = av_find_input_format(arg);
-    if (!file_iformat) {
+    if (!(file_iformat = av_find_input_format(arg)) &&
+        !(file_iformat = av_demuxer_find_by_ext(arg))) {
         av_log(NULL, AV_LOG_FATAL, "Unknown input format: %s\n", arg);
         return AVERROR(EINVAL);
     }