diff options
author | Aurelien Jacobs | 2010-11-13 13:57:49 +0000 |
---|---|---|
committer | Aurelien Jacobs | 2010-11-13 13:57:49 +0000 |
commit | cb2c971d91ef166914a4982e941aa71ffd496610 (patch) | |
tree | c9be6025b40a978ff442d052a722e0b82e6862bb /libavformat/utils.c | |
parent | 2722dd6ebf9d93ab097c303df1d789f6074121c8 (diff) |
allow passing subtitles header between decoder and encoder
Originally committed as revision 25745 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 36e93bc215..8fcbe96eea 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2206,9 +2206,14 @@ int av_find_stream_info(AVFormatContext *ic) if (codec && codec->capabilities & CODEC_CAP_CHANNEL_CONF) st->codec->channels = 0; + /* Ensure that subtitle_header is properly set. */ + if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE + && codec && !st->codec->codec) + avcodec_open(st->codec, codec); + //try to just open decoders, in case this is enough to get parameters if(!has_codec_parameters(st->codec)){ - if (codec) + if (codec && !st->codec->codec) avcodec_open(st->codec, codec); } } @@ -2471,6 +2476,7 @@ void av_close_input_stream(AVFormatContext *s) av_metadata_free(&st->metadata); av_free(st->index_entries); av_free(st->codec->extradata); + av_free(st->codec->subtitle_header); av_free(st->codec); #if FF_API_OLD_METADATA av_free(st->filename); |