Browse code

ffmpeg_opt: check that a subtitle encoder is available before auto mapping streams

Fixes Ticket3470

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

Michael Niedermayer authored on 2014/03/16 23:15:02
Showing 1 changed files
... ...
@@ -1833,7 +1833,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
1833 1833
 
1834 1834
         /* subtitles: pick first */
1835 1835
         MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
1836
-        if (!o->subtitle_disable && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
1836
+        if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
1837 1837
             for (i = 0; i < nb_input_streams; i++)
1838 1838
                 if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
1839 1839
                     new_subtitle_stream(o, oc, i);