From 9dec8f2b6de1e03219d55c024f788aa50faf4d23 Mon Sep 17 00:00:00 2001
From: Ivan Uskov <ivan.uskov@nablet.com>
Date: Thu, 6 Aug 2015 09:30:42 -0400
Subject: [PATCH 2/3] libavcodec/qsvdec.c: Extended error messages for
 MFXVideoDECODE_Init() result

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

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index ae757cb..51ad2f7 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -113,7 +113,13 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
 
     ret = MFXVideoDECODE_Init(q->session, &param);
     if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing the MFX video decoder\n");
+        if (MFX_ERR_INVALID_VIDEO_PARAM==ret) {
+            av_log(avctx, AV_LOG_ERROR,
+                   "Error initializing the MFX video decoder, unsupported video\n");
+        } else {
+            av_log(avctx, AV_LOG_ERROR,
+                   "Error initializing the MFX video decoder %d\n", ret);
+        }
         return ff_qsv_error(ret);
     }
 
-- 
1.8.3.1

