changeset 2791:f191093dc8fe libavcodec

check for CODEC_CAP_DELAY in audio decoders too
author michael
date Thu, 14 Jul 2005 15:30:39 +0000
parents 5446a52ad4df
children 0a8c847ad5e7
files utils.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Thu Jul 14 14:34:39 2005 +0000
+++ b/utils.c	Thu Jul 14 15:30:39 2005 +0000
@@ -642,9 +642,12 @@
     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;
 }