Mercurial > libavcodec.hg
diff pcm.c @ 4351:1e251b54cba2 libavcodec
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
author | michael |
---|---|
date | Sun, 14 Jan 2007 23:50:06 +0000 |
parents | c8c591fe26f8 |
children | 709ddd620e04 |
line wrap: on
line diff
--- a/pcm.c Sun Jan 14 23:19:22 2007 +0000 +++ b/pcm.c Sun Jan 14 23:50:06 2007 +0000 @@ -410,8 +410,8 @@ 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: