[FFmpeg-devel,2/2] lavc/qsv: handle MFX_FRAMETYPE_UNKNOWN case

Submitted by Zhong Li on July 3, 2018, 8:29 a.m.

Details

Message ID 1530606579-17036-2-git-send-email-zhong.li@intel.com
State Accepted
Commit 3c26ce464435673fe1c0e96a4d5f435b964db8d1
Headers show

Commit Message

Zhong Li July 3, 2018, 8:29 a.m.
Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 3ff4f2c..bb0d795 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -198,7 +198,7 @@  int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
 
 enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
 {
-    enum AVPictureType type = AV_PICTURE_TYPE_NONE;
+    enum AVPictureType type;
     switch (mfx_pic_type & 0x7) {
     case MFX_FRAMETYPE_I:
         if (mfx_pic_type & MFX_FRAMETYPE_S)
@@ -215,6 +215,9 @@  enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
         else
             type = AV_PICTURE_TYPE_P;
         break;
+    case MFX_FRAMETYPE_UNKNOWN:
+        type = AV_PICTURE_TYPE_NONE;
+        break;
     default:
         av_assert0(0);
     }