Browse Source

ffmpeg/opt_output_file: extract subtitle codec name through new API

This should fix specifying subtitle codecs with the new syntax in some cases.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 12 years ago
parent
commit
8ccb56abee
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      ffmpeg_opt.c

+ 2
- 0
ffmpeg_opt.c View File

@@ -1496,6 +1496,7 @@ void opt_output_file(void *optctx, const char *filename)
} }
} }
} else if (!o->nb_stream_maps) { } else if (!o->nb_stream_maps) {
char *subtitle_codec_name = NULL;
/* pick the "best" stream of each type */ /* pick the "best" stream of each type */


/* video: highest resolution */ /* video: highest resolution */
@@ -1532,6 +1533,7 @@ void opt_output_file(void *optctx, const char *filename)
} }


/* subtitles: pick first */ /* 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 && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
for (i = 0; i < nb_input_streams; i++) for (i = 0; i < nb_input_streams; i++)
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {


Loading…
Cancel
Save