diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 23:50:06 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 23:50:06 +0000 |
commit | ac66834c759b7130fb5be51f63cb6dff9b294cba (patch) | |
tree | 8848eb2ec4306ff0babb163fede2da388f981c42 /libavcodec/pcm.c | |
parent | aeeb0cac3d8ace239ce1fe0d98858ebbd37029a7 (diff) | |
download | ffmpeg-ac66834c759b7130fb5be51f63cb6dff9b294cba.tar.gz |
avcodec_decode_audio2()
difference to avcodec_decode_audio() is that the user can pass the allocated size of the output buffer to the decoder and the decoder can check if theres enough space
Originally committed as revision 7518 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 26c38b3298..4011ed3b57 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -410,8 +410,8 @@ static int pcm_decode_frame(AVCodecContext *avctx, samples = data; src = buf; - if(buf_size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2) - buf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE/2; + buf_size= FFMIN(buf_size, *data_size/2); + *data_size=0; switch(avctx->codec->id) { case CODEC_ID_PCM_S32LE: |