[FFmpeg-devel] [PATCH] fftools/cmdutils: add no demuxer/muxer name specified message
Steven Liu
lq at chinaffmpeg.org
Sat Feb 1 01:37:04 EET 2020
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
fftools/cmdutils.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index f0f2b4fde4..6e387ccb10 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1854,8 +1854,14 @@ 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 = NULL;
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No demuxer name specified.\n");
+ return;
+ }
+
+ fmt = av_find_input_format(name);
if (!fmt) {
av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
return;
@@ -1891,8 +1897,13 @@ static void show_help_protocol(const char *name)
static void show_help_muxer(const char *name)
{
const AVCodecDescriptor *desc;
- const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL);
+ const AVOutputFormat *fmt = NULL;
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No muxer name specified.\n");
+ return;
+ }
+ fmt = av_guess_format(name, NULL, NULL);
if (!fmt) {
av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
return;
--
2.17.2 (Apple Git-113)
More information about the ffmpeg-devel
mailing list