avconv_dxva2: add a profile check for hevc
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 30 Jan 2016 16:11:13 +0000 (17:11 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 20 Jul 2016 14:33:09 +0000 (16:33 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
avconv_dxva2.c

index 9cf09cd..7578c3f 100644 (file)
@@ -422,6 +422,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);
+    }
+
     av_buffer_unref(&ctx->hw_frames_ctx);
 
     ret = dxva2_create_decoder(s);