diff options
author | Lynne <dev@lynne.ee> | 2022-12-14 00:02:11 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:28 +0200 |
commit | dc2694557d41d0ff276d8da268e35bea39e42602 (patch) | |
tree | ffa5162a2d9fe9f694924f46f6e5d7d91b11cd46 | |
parent | b6a6e2b19da74c44a0f3f0821d499c032bc74647 (diff) | |
download | ffmpeg-dc2694557d41d0ff276d8da268e35bea39e42602.tar.gz |
h2645_vui: expose aspect_ratio_idc
-rw-r--r-- | libavcodec/h2645_vui.c | 10 | ||||
-rw-r--r-- | libavcodec/h2645_vui.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/h2645_vui.c b/libavcodec/h2645_vui.c index 0633fcbddd..93e83a9e1f 100644 --- a/libavcodec/h2645_vui.c +++ b/libavcodec/h2645_vui.c @@ -42,15 +42,15 @@ void ff_h2645_decode_common_vui_params(GetBitContext *gb, H2645VUI *vui, void *l aspect_ratio_info_present_flag = get_bits1(gb); if (aspect_ratio_info_present_flag) { - uint8_t aspect_ratio_idc = get_bits(gb, 8); - if (aspect_ratio_idc < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) - vui->sar = ff_h2645_pixel_aspect[aspect_ratio_idc]; - else if (aspect_ratio_idc == EXTENDED_SAR) { + vui->aspect_ratio_idc = get_bits(gb, 8); + if (vui->aspect_ratio_idc < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) + vui->sar = ff_h2645_pixel_aspect[vui->aspect_ratio_idc]; + else if (vui->aspect_ratio_idc == EXTENDED_SAR) { vui->sar.num = get_bits(gb, 16); vui->sar.den = get_bits(gb, 16); } else av_log(logctx, AV_LOG_WARNING, - "Unknown SAR index: %u.\n", aspect_ratio_idc); + "Unknown SAR index: %u.\n", vui->aspect_ratio_idc); } else vui->sar = (AVRational){ 0, 1 }; diff --git a/libavcodec/h2645_vui.h b/libavcodec/h2645_vui.h index 638da7c366..f1aeab7758 100644 --- a/libavcodec/h2645_vui.h +++ b/libavcodec/h2645_vui.h @@ -26,6 +26,7 @@ typedef struct H2645VUI { AVRational sar; + int aspect_ratio_idc; int overscan_info_present_flag; int overscan_appropriate_flag; |