aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/aiffdec.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2009-11-30 22:01:21 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-11-30 22:01:21 +0000
commitcea65433e087f1a6e3fafb41d99f930d78f9380a (patch)
tree54e3683c9e6db5dfac9f8227ba19a66bea674535 /libavformat/aiffdec.c
parent0a04566120548cdcb6695dedffc55cf967e422d3 (diff)
downloadffmpeg-cea65433e087f1a6e3fafb41d99f930d78f9380a.tar.gz
decode qcelp in aiff, implement #1524, patch by Vitor
Originally committed as revision 20674 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r--libavformat/aiffdec.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 6cc91d4c19..60c44ea5e8 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -127,6 +127,10 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
codec->block_align = 33;
codec->frame_size = 160;
break;
+ case CODEC_ID_QCELP:
+ codec->block_align = 35;
+ codec->frame_size= 160;
+ break;
default:
break;
}
@@ -284,7 +288,7 @@ static int aiff_read_packet(AVFormatContext *s,
AVStream *st = s->streams[0];
AIFFInputContext *aiff = s->priv_data;
int64_t max_size;
- int res;
+ int res, size;
/* calculate size of remaining data */
max_size = aiff->data_end - url_ftell(s->pb);
@@ -292,8 +296,12 @@ static int aiff_read_packet(AVFormatContext *s,
return AVERROR_EOF;
/* Now for that packet */
- max_size = FFMIN(max_size, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
- res = av_get_packet(s->pb, pkt, max_size);
+ if (st->codec->block_align >= 33) // GSM, QCLP, IMA4
+ size = st->codec->block_align;
+ else
+ size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
+ size = FFMIN(max_size, size);
+ res = av_get_packet(s->pb, pkt, size);
if (res < 0)
return res;