aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-02-27 13:07:38 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-02-27 13:07:38 +0000
commit3fdb6af943dde215e761f37b3135801ad4399be9 (patch)
tree3f8f92c08e9f4866eee736ffb85ed3490caf0d19 /libavformat
parentee5db69e8506d8d970282f29339649d9d4bb87ea (diff)
downloadffmpeg-3fdb6af943dde215e761f37b3135801ad4399be9.tar.gz
use avcodec_decode_audio2
Originally committed as revision 8146 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 04ee6f2636..d3fae29cff 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1750,7 +1750,7 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
{
int16_t *samples;
AVCodec *codec;
- int got_picture, ret=0;
+ int got_picture, data_size, ret=0;
AVFrame picture;
if(!st->codec->codec){
@@ -1769,11 +1769,12 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
&got_picture, (uint8_t *)data, size);
break;
case CODEC_TYPE_AUDIO:
- samples = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
+ data_size = FFMAX(size, AVCODEC_MAX_AUDIO_FRAME_SIZE);
+ samples = av_malloc(data_size);
if (!samples)
goto fail;
- ret = avcodec_decode_audio(st->codec, samples,
- &got_picture, (uint8_t *)data, size);
+ ret = avcodec_decode_audio2(st->codec, samples,
+ &data_size, (uint8_t *)data, size);
av_free(samples);
break;
default: