[FFmpeg-devel] [PATCH 2/4] h264_levels: Make get_level intra-profile friendly

Andreas Rheinhardt andreas.rheinhardt at googlemail.com
Mon Nov 12 16:18:13 EET 2018


Currently ff_h264_get_level does not provide the correct level for any
of the High Intra profiles. Now only High Intra profiles with level 1.1
get misdetected.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at googlemail.com>
---
 libavcodec/h264_levels.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_levels.c b/libavcodec/h264_levels.c
index 7a55116773..02efaa38dc 100644
--- a/libavcodec/h264_levels.c
+++ b/libavcodec/h264_levels.c
@@ -80,8 +80,8 @@ const H264LevelDescriptor *ff_h264_get_level(int level_idc,
 {
     int i;
     for (i = 0; i < FF_ARRAY_ELEMS(h264_levels); i++) {
-        if (h264_levels[i].level_idc            == level_idc &&
-            h264_levels[i].constraint_set3_flag == constraint_set3_flag)
+        if (h264_levels[i].level_idc == level_idc &&
+            (constraint_set3_flag || !h264_levels[i].constraint_set3_flag))
             return &h264_levels[i];
     }
     return NULL;
-- 
2.19.0



More information about the ffmpeg-devel mailing list