summaryrefslogtreecommitdiff
path: root/libavformat/aiff.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-25 10:57:22 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-25 10:57:22 +0000
commit3a957df49e636a3ddd8cbc2bd82917c733573384 (patch)
treeb95554c991b588a2ebabaf44b0e08e3f80a91329 /libavformat/aiff.c
parent4a5b619df74ea6a5d476fc4f91cbb98b5aa5098a (diff)
ima4 in aiff support
Originally committed as revision 12196 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aiff.c')
-rw-r--r--libavformat/aiff.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/aiff.c b/libavformat/aiff.c
index f840c176da..1fcfd881b4 100644
--- a/libavformat/aiff.c
+++ b/libavformat/aiff.c
@@ -37,6 +37,7 @@ static const AVCodecTag codec_aiff_tags[] = {
{ CODEC_ID_GSM, MKTAG('G','S','M',' ') },
{ CODEC_ID_ADPCM_G726, MKTAG('G','7','2','6') },
{ CODEC_ID_PCM_S16LE, MKTAG('s','o','w','t') },
+ { CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') },
{ 0, 0 },
};
@@ -123,11 +124,17 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
codec->codec_tag = get_le32(pb);
codec->codec_id = codec_get_id (codec_aiff_tags, codec->codec_tag);
- if (codec->codec_id == CODEC_ID_PCM_S16BE) {
+ switch (codec->codec_id) {
+ case CODEC_ID_PCM_S16BE:
codec->codec_id = aiff_codec_get_id (codec->bits_per_sample);
codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id);
+ break;
+ case CODEC_ID_ADPCM_IMA_QT:
+ codec->block_align = 34*codec->channels;
+ break;
+ default:
+ break;
}
-
size -= 4;
} else {
/* Need the codec type */
@@ -140,7 +147,8 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
/* Block align needs to be computed in all cases, as the definition
* is specific to applications -> here we use the WAVE format definition */
- codec->block_align = (codec->bits_per_sample * codec->channels) >> 3;
+ if (!codec->block_align)
+ codec->block_align = (codec->bits_per_sample * codec->channels) >> 3;
codec->bit_rate = codec->sample_rate * (codec->block_align << 3);