summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-23 18:09:06 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-23 18:09:06 +0000
commit934982c4ace1a3d5d627b518782ed092a456c49e (patch)
tree2710f7ff4b0238136300d02da7baf234ed48cc01 /libavcodec/utils.c
parent884182b383ed8b70a67634dc7f91395c402b58d7 (diff)
avoid buf_size == 0 checks in every decoder
Originally committed as revision 3872 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c51efd110f..325883cdb8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -587,13 +587,17 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
return -1;
- ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
- buf, buf_size);
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
+ ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
+ buf, buf_size);
- emms_c(); //needed to avoid a emms_c() call before every return;
+ emms_c(); //needed to avoid a emms_c() call before every return;
- if (*got_picture_ptr)
- avctx->frame_number++;
+ if (*got_picture_ptr)
+ avctx->frame_number++;
+ }else
+ ret= 0;
+
return ret;
}