cmdutils/filter_codec_opts: do not discard all options for CODEC_ID_NONE
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 28 Mar 2014 15:03:33 +0000 (16:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 28 Mar 2014 16:29:26 +0000 (17:29 +0100)
This fixes cases where the codec is detect later than the stream creation
No testcase with unmodified source known

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cmdutils.c

index dc9bd2c..be3189a 100644 (file)
@@ -1942,7 +1942,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
             }
 
         if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
-            (codec && codec->priv_class &&
+            !codec ||
+            (codec->priv_class &&
              av_opt_find(&codec->priv_class, t->key, NULL, flags,
                          AV_OPT_SEARCH_FAKE_OBJ)))
             av_dict_set(&ret, t->key, t->value, 0);