aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/bink.c
diff options
context:
space:
mode:
authorKostya <kostya.shishkov@gmail.com>2011-06-17 07:28:58 +0000
committerAnton Khirnov <anton@khirnov.net>2011-07-06 14:52:02 +0200
commitdf64da3b1ef0c7014135bce44e5f82becf81fe79 (patch)
treee9ecb6e91da26d99497ab733cc0df9a41e5ad0ee /libavformat/bink.c
parent0fedf754b24331ae80a50816cd02ad0eba9beba4 (diff)
downloadffmpeg-df64da3b1ef0c7014135bce44e5f82becf81fe79.tar.gz
bink: pass Bink version to audio decoder through extradata instead of codec_tag.
This is needed because not all players (e.g. MPlayer) are able to distinguish two different Bink audio decoders when codec_tag is set. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r--libavformat/bink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 76b457c21b..067673819a 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -134,13 +134,18 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!ast)
return AVERROR(ENOMEM);
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- ast->codec->codec_tag = vst->codec->codec_tag;
+ ast->codec->codec_tag = 0;
ast->codec->sample_rate = avio_rl16(pb);
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
flags = avio_rl16(pb);
ast->codec->codec_id = flags & BINK_AUD_USEDCT ?
CODEC_ID_BINKAUDIO_DCT : CODEC_ID_BINKAUDIO_RDFT;
ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1;
+ ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!ast->codec->extradata)
+ return AVERROR(ENOMEM);
+ ast->codec->extradata_size = 4;
+ AV_WL32(ast->codec->extradata, vst->codec->codec_tag);
}
for (i = 0; i < bink->num_audio_tracks; i++)