Mercurial > libavformat.hg
changeset 5607:9143e8efec99 libavformat
Demux Bink audio in Smacker files
author | daniel |
---|---|
date | Sat, 30 Jan 2010 10:31:10 +0000 |
parents | 2023dcca33ff |
children | cdc913460d61 |
files | smacker.c |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/smacker.c Sat Jan 30 09:47:57 2010 +0000 +++ b/smacker.c Sat Jan 30 10:31:10 2010 +0000 @@ -172,12 +172,20 @@ /* handle possible audio streams */ for(i = 0; i < 7; i++) { smk->indexes[i] = -1; - if((smk->rates[i] & 0xFFFFFF) && !(smk->rates[i] & SMK_AUD_BINKAUD)){ + if(smk->rates[i] & 0xFFFFFF){ ast[i] = av_new_stream(s, 0); smk->indexes[i] = ast[i]->index; ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; - ast[i]->codec->codec_id = (smk->rates[i] & SMK_AUD_PACKED) ? CODEC_ID_SMACKAUDIO : CODEC_ID_PCM_U8; - ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A'); + if (smk->rates[i] & SMK_AUD_BINKAUD) { + ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_RDFT; + } else if (smk->rates[i] & SMK_AUD_USEDCT) { + ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_DCT; + } else if (smk->rates[i] & SMK_AUD_PACKED){ + ast[i]->codec->codec_id = CODEC_ID_SMACKAUDIO; + ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A'); + } else { + ast[i]->codec->codec_id = CODEC_ID_PCM_U8; + } ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1; ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF; ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;