aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2009-03-19 22:29:32 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2009-03-19 22:29:32 +0000
commit90da2b50865549e086d4491cbb2bdc54af38ea4f (patch)
treece284ed0f53adb14effc067aaad5756c991f8a99 /ffmpeg.c
parent876578914ba219c627aabf48d5f71151b37d6906 (diff)
downloadffmpeg-90da2b50865549e086d4491cbb2bdc54af38ea4f.tar.gz
Make ffmpeg fail if the argument provided to the -pix_fmt option is
invalid. Originally committed as revision 18053 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 99335f86ed..14aa07ee87 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2536,9 +2536,13 @@ static void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt),
static void opt_frame_pix_fmt(const char *arg)
{
- if (strcmp(arg, "list"))
+ if (strcmp(arg, "list")) {
frame_pix_fmt = avcodec_get_pix_fmt(arg);
- else {
+ if (frame_pix_fmt == PIX_FMT_NONE) {
+ fprintf(stderr, "Unknown pixel format requested: %s\n", arg);
+ av_exit(1);
+ }
+ } else {
list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB);
av_exit(0);
}