# HG changeset patch # User bcoudurier # Date 1172581658 0 # Node ID 0c28d35086f51c2211fcf859456aa6eafe5080df # Parent a94e1560b02674f1648a92f2471137235b5631ee use avcodec_decode_audio2 diff -r a94e1560b026 -r 0c28d35086f5 utils.c --- a/utils.c Tue Feb 27 00:18:38 2007 +0000 +++ b/utils.c Tue Feb 27 13:07:38 2007 +0000 @@ -1750,7 +1750,7 @@ { 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 @@ &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: