[FFmpeg-cvslog] ffmpeg_opt: check that a subtitle encoder is available before auto mapping streams

Michael Niedermayer git at videolan.org
Mon Mar 17 16:08:29 CET 2014


ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Sun Mar 16 15:15:02 2014 +0100| [db53b2b2c0f7b150d0363c4de0d0ca69c9c3c805] | committer: Carl Eugen Hoyos

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

Fixes Ticket3470

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 25bcf24d4d0faf0191923be8afac8f67ca98b500)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db53b2b2c0f7b150d0363c4de0d0ca69c9c3c805
---

 ffmpeg_opt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index d154807..4d3633f 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1728,7 +1728,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
 
         /* subtitles: pick first */
         MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
-        if (!o->subtitle_disable && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
+        if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
             for (i = 0; i < nb_input_streams; i++)
                 if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
                     new_subtitle_stream(o, oc, i);



More information about the ffmpeg-cvslog mailing list