[FFmpeg-cvslog] r18053 - trunk/ffmpeg.c

stefano subversion
Thu Mar 19 23:29:32 CET 2009


Author: stefano
Date: Thu Mar 19 23:29:32 2009
New Revision: 18053

Log:
Make ffmpeg fail if the argument provided to the -pix_fmt option is
invalid.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Thu Mar 19 22:57:14 2009	(r18052)
+++ trunk/ffmpeg.c	Thu Mar 19 23:29:32 2009	(r18053)
@@ -2536,9 +2536,13 @@ static void list_fmts(void (*get_fmt_str
 
 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);
     }




More information about the ffmpeg-cvslog mailing list