diff options
author | Daniel Verkamp <daniel@drv.nu> | 2010-01-30 10:31:10 +0000 |
---|---|---|
committer | Daniel Verkamp <daniel@drv.nu> | 2010-01-30 10:31:10 +0000 |
commit | 895ab7489b6f623cd2250bc197dfe96d9d4eb63a (patch) | |
tree | d677830268c47ea3b6c6c4a1be803da5c9eef32d /libavformat/smacker.c | |
parent | 4e5f42dd79d36d6c484335b1f5335f4ef8c958d7 (diff) | |
download | ffmpeg-895ab7489b6f623cd2250bc197dfe96d9d4eb63a.tar.gz |
Demux Bink audio in Smacker files
Originally committed as revision 21537 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r-- | libavformat/smacker.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 8ec28bcd3b..7585ff1a9a 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -172,12 +172,20 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) /* 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; |