[FFmpeg-devel] [PATCH 03/10] avcodec/dca: print error message when no frame is found in packet

foo86 foobaz86 at gmail.com
Fri May 13 11:48:25 CEST 2016


---
 libavcodec/dcadec.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index dac86eb..e3a4b0d 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -179,8 +179,10 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
     for (i = 0, ret = AVERROR_INVALIDDATA; i < input_size - MIN_PACKET_SIZE + 1 && ret < 0; i++)
         ret = convert_bitstream(input + i, input_size - i, s->buffer, s->buffer_size);
 
-    if (ret < 0)
+    if (ret < 0) {
+        av_log(avctx, AV_LOG_ERROR, "Not a valid DCA frame\n");
         return ret;
+    }
 
     input      = s->buffer;
     input_size = ret;
@@ -292,6 +294,9 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
         if (s->core.filter_mode & DCA_FILTER_MODE_FIXED)
             s->packet |= DCA_PACKET_RESIDUAL;
     } else {
+        av_log(avctx, AV_LOG_ERROR, "No valid DCA sub-stream found\n");
+        if (s->core_only)
+            av_log(avctx, AV_LOG_WARNING, "Consider disabling 'core_only' option\n");
         return AVERROR_INVALIDDATA;
     }
 
-- 
2.8.1



More information about the ffmpeg-devel mailing list