[Ffmpeg-cvslog] r8146 - trunk/libavformat/utils.c
bcoudurier
subversion
Tue Feb 27 14:07:39 CET 2007
Author: bcoudurier
Date: Tue Feb 27 14:07:38 2007
New Revision: 8146
Modified:
trunk/libavformat/utils.c
Log:
use avcodec_decode_audio2
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c (original)
+++ trunk/libavformat/utils.c Tue Feb 27 14:07:38 2007
@@ -1750,7 +1750,7 @@ static int try_decode_frame(AVStream *st
{
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
&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:
More information about the ffmpeg-cvslog
mailing list