summaryrefslogtreecommitdiff
path: root/libavcodec/binkaudio.c
diff options
context:
space:
mode:
authorIvan Kalvachev <ikalvachev@gmail.com>2011-06-16 19:35:33 +0300
committerMichael Niedermayer <michaelni@gmx.at>2011-06-20 23:28:55 +0200
commit093768c9a4855b82c13124f835b655dd70883012 (patch)
tree6d64245937efda9cf495ac00d1c0d0987d341b1c /libavcodec/binkaudio.c
parentcfbaeb311d906099bd9b8fbf0fa38cdb1b08f23e (diff)
Fix bink audio playback outside of FFmpeg.
There are 2 known Bink audio codecs. Additionally they have a different flavor if they are found inside Bink-b "BIKb" file. In order to guess the correct flavor, the demuxer sets the audio codec_tag to be the same as the file format tag. This causes problem because same tag is used for both audio codecs. The hack works in FFmpeg because audio codecs are identified by their codec_id, but other players rely on standard behavior. This fix removes the codec_tag hack and instead uses artificial extradata format to signal the codec flavor. This would also allow proper embedding of Bink audio in other containers. Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/binkaudio.c')
-rw-r--r--libavcodec/binkaudio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index bf1d412ed1..ff36458c7e 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -90,7 +90,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
return -1;
}
- s->version_b = avctx->codec_tag == MKTAG('B','I','K','b');
+ if (avctx->extradata && avctx->extradata_size > 0)
+ s->version_b = avctx->extradata[0];
if (avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) {
// audio is already interleaved for the RDFT format variant