aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_ps.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-30 17:44:34 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-02-01 10:34:23 +0100
commitf85cc3bf12236e974403667610b39b802b8651d6 (patch)
tree1b2f27ee000a7538334ad9c7a5547b6a93e7ca60 /libavcodec/hevc_ps.c
parent70742e599b6698f14d08af745c119c16711cd5ba (diff)
downloadffmpeg-f85cc3bf12236e974403667610b39b802b8651d6.tar.gz
hevc: set profile based on the profile compatibility flags if needed
This fixes retrieving a valid profile for many of the FATE conformance samples, allowing them to be properly decoded by the HWAccel after adding a profile check.
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r--libavcodec/hevc_ps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 14f908e8de..64d6e2f064 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -257,8 +257,12 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
else
av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
- for (i = 0; i < 32; i++)
+ for (i = 0; i < 32; i++) {
ptl->profile_compatibility_flag[i] = get_bits1(gb);
+
+ if (ptl->profile_idc == 0 && i > 0 && ptl->profile_compatibility_flag[i])
+ ptl->profile_idc = i;
+ }
ptl->progressive_source_flag = get_bits1(gb);
ptl->interlaced_source_flag = get_bits1(gb);
ptl->non_packed_constraint_flag = get_bits1(gb);