Browse code

cmdutils: Allow calling filter_codec_opts without a set encoder

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>

Martin Storsjö authored on 2013/02/28 06:21:06
Showing 1 changed files
... ...
@@ -1462,10 +1462,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
1462 1462
     if (!codec)
1463 1463
         codec            = s->oformat ? avcodec_find_encoder(codec_id)
1464 1464
                                       : avcodec_find_decoder(codec_id);
1465
-    if (!codec)
1466
-        return NULL;
1467 1465
 
1468
-    switch (codec->type) {
1466
+    switch (st->codec->codec_type) {
1469 1467
     case AVMEDIA_TYPE_VIDEO:
1470 1468
         prefix  = 'v';
1471 1469
         flags  |= AV_OPT_FLAG_VIDEO_PARAM;