aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-07-14 15:30:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-07-14 15:30:39 +0000
commitfec9ccb7e6fdc6844b1e2d1bb95436b36f47a412 (patch)
tree35edf68a86aa07a2572611cfe7fff1afe36f6b29 /libavcodec
parent46044471a0193b05b6c7bee1769f4822125ea6dc (diff)
downloadffmpeg-fec9ccb7e6fdc6844b1e2d1bb95436b36f47a412.tar.gz
check for CODEC_CAP_DELAY in audio decoders too
Originally committed as revision 4439 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5bd0012a47..0a0971fc3e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -642,9 +642,12 @@ int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int ret;
*frame_size_ptr= 0;
- ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
- buf, buf_size);
- avctx->frame_number++;
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
+ ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
+ buf, buf_size);
+ avctx->frame_number++;
+ }else
+ ret= 0;
return ret;
}