ffmpeg: offer alternatives for experimental codecs if they exist
authorJanne Grunau <janne-ffmpeg@jannau.net>
Mon, 31 May 2010 22:35:14 +0000 (22:35 +0000)
committerJanne Grunau <janne-ffmpeg@jannau.net>
Mon, 31 May 2010 22:35:14 +0000 (22:35 +0000)
Originally committed as revision 23398 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c

index e0e9cb2..bf57883 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3091,6 +3091,12 @@ static enum CodecID find_codec_or_die(const char *name, int type, int encoder, i
         fprintf(stderr, "%s '%s' is experimental and might produce bad "
                 "results.\nAdd '-strict experimental' if you want to use it.\n",
                 codec_string, codec->name);
+        codec = encoder ?
+            avcodec_find_encoder(codec->id) :
+            avcodec_find_decoder(codec->id);
+        if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
+            fprintf(stderr, "Or use the non experimental %s '%s'.\n",
+                    codec_string, codec->name);
         av_exit(1);
     }
     return codec->id;