summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_decode.c
diff options
context:
space:
mode:
authorJun Zhao <mypopydev@gmail.com>2017-10-09 15:50:19 +0800
committerMark Thompson <sw@jkqxz.net>2017-10-09 23:08:49 +0100
commit217a723b4e0573129c4ec9c31ca3ee666a2a64f6 (patch)
treeb3be863d4657a99acb959935ef003b121988bce6 /libavcodec/vaapi_decode.c
parent71e2ec017a1b51987d50b97d48b6a6114a58507d (diff)
lavc/vaapi_decode: fix profile search when profile mismatch is allowed
When profile mismatch is allowed, use the highest supported profile for VAAPI decoding. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/vaapi_decode.c')
-rw-r--r--libavcodec/vaapi_decode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 5a555b2bd3..27ef33837c 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -281,7 +281,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
VAStatus vas;
int err, i, j;
const AVCodecDescriptor *codec_desc;
- VAProfile profile, *profile_list = NULL;
+ VAProfile profile, va_profile, *profile_list = NULL;
int profile_count, exact_match, alt_profile;
const AVPixFmtDescriptor *sw_desc, *desc;
@@ -328,6 +328,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
if (exact_match)
break;
alt_profile = vaapi_profile_map[i].codec_profile;
+ va_profile = vaapi_profile_map[i].va_profile;
}
}
av_freep(&profile_list);
@@ -347,6 +348,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
av_log(avctx, AV_LOG_WARNING, "Using possibly-"
"incompatible profile %d instead.\n",
alt_profile);
+ profile = va_profile;
} else {
av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
"supported for hardware decode.\n",