1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/hevc/ps: print the correct unsupported scalability value found

With multilayer001.heic, which signals Spatial scalability:

Before:
[hevc @ ...] Scalability type 1 not supported
[hevc @ ...] Ignoring unsupported VPS extension

After:
[hevc @ ...] Scalability type 2 not supported
[hevc @ ...] Ignoring unsupported VPS extension

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-10-03 14:47:30 -03:00
parent 099f88b864
commit 32e34692fb

View File

@ -470,7 +470,7 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
PTL ptl_dummy;
uint8_t max_sub_layers[HEVC_MAX_LAYERS];
int splitting_flag, dimension_id_len, view_id_len, num_add_olss,
int splitting_flag, dimension_id_len, view_id_len, num_add_olss, num_scalability_types,
default_output_layer_idc, direct_dep_type_len, direct_dep_type,
sub_layers_max_present, sub_layer_flag_info_present_flag, nb_ptl;
unsigned non_vui_extension_length;
@ -532,13 +532,17 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
return AVERROR_INVALIDDATA;
splitting_flag = get_bits1(gb);
num_scalability_types = 0;
for (int i = 0; i <= HEVC_SCALABILITY_MASK_MAX; i++) {
int scalability_mask_flag = get_bits1(gb);
if (scalability_mask_flag != (i == HEVC_SCALABILITY_MULTIVIEW)) {
if (scalability_mask_flag && (i != HEVC_SCALABILITY_MULTIVIEW)) {
av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n", i);
return AVERROR_PATCHWELCOME;
}
num_scalability_types += scalability_mask_flag;
}
if (num_scalability_types != 1)
return AVERROR_INVALIDDATA;
if (!splitting_flag)
dimension_id_len = get_bits(gb, 3) + 1;