From: Aman Gupta <a...@tmm1.net>

---
 libavcodec/videotoolbox.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 1de556f3e8..f56ab1f8c9 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -425,7 +425,22 @@ static int videotoolbox_common_end_frame(AVCodecContext 
*avctx, AVFrame *frame)
     status = videotoolbox_session_decode_frame(avctx);
 
     if (status) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
+        const char *error = NULL;
+        switch (status) {
+            case kVTVideoDecoderBadDataErr:
+                error = "bad data";
+                break;
+            case kVTVideoDecoderMalfunctionErr:
+                error = "decoder malfunction";
+                break;
+            case kVTInvalidSessionErr:
+                error = "invalid session";
+                break;
+            default:
+                error = "unknown";
+                break;
+        }
+        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%s, %d)\n", 
error, status);
         return AVERROR_UNKNOWN;
     }
 
-- 
2.13.5 (Apple Git-94)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to