cmdutils: Allow calling filter_codec_opts without a set encoder
authorMartin Storsjö <martin@martin.st>
Wed, 27 Feb 2013 21:21:06 +0000 (23:21 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 28 Feb 2013 16:30:40 +0000 (18:30 +0200)
In this case, no encoder specific options are filtered, only
options specific to that codec type in general.

Signed-off-by: Martin Storsjö <martin@martin.st>
cmdutils.c

index 688f501..fa56326 100644 (file)
@@ -1462,10 +1462,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
     if (!codec)
         codec            = s->oformat ? avcodec_find_encoder(codec_id)
                                       : avcodec_find_decoder(codec_id);
-    if (!codec)
-        return NULL;
 
-    switch (codec->type) {
+    switch (st->codec->codec_type) {
     case AVMEDIA_TYPE_VIDEO:
         prefix  = 'v';
         flags  |= AV_OPT_FLAG_VIDEO_PARAM;