ffmpeg_dxva2: add a profile check for hevc
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 30 Jan 2016 16:11:13 +0000 (17:11 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 15 Feb 2016 11:34:19 +0000 (12:34 +0100)
ffmpeg_dxva2.c

index 43509b4..09af6c7 100644 (file)
@@ -637,6 +637,12 @@ int dxva2_init(AVCodecContext *s)
         return AVERROR(EINVAL);
     }
 
+    if (s->codec_id == AV_CODEC_ID_HEVC &&
+        s->profile != FF_PROFILE_HEVC_MAIN && s->profile != FF_PROFILE_HEVC_MAIN_10) {
+        av_log(NULL, loglevel, "Unsupported HEVC profile for DXVA2 HWAccel: %d\n", s->profile);
+        return AVERROR(EINVAL);
+    }
+
     if (ctx->decoder)
         dxva2_destroy_decoder(s);