diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c index 0cb003807a..d4ad4c21ce 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.c +++ b/gst-libs/gst/codecparsers/gsth265parser.c @@ -2271,10 +2271,13 @@ gst_h265_parser_parse_slice_hdr (GstH265Parser * parser, READ_UINT8 (&nr, slice->short_term_ref_pic_set_sps_flag, 1); if (!slice->short_term_ref_pic_set_sps_flag) { + guint pos = nal_reader_get_pos (&nr); if (!gst_h265_parser_parse_short_term_ref_pic_sets (&slice->short_term_ref_pic_sets, &nr, sps->num_short_term_ref_pic_sets, sps)) goto error; + + slice->short_term_ref_pic_set_size = nal_reader_get_pos (&nr) - pos; } else if (sps->num_short_term_ref_pic_sets > 1) { const guint n = ceil_log2 (sps->num_short_term_ref_pic_sets); READ_UINT8 (&nr, slice->short_term_ref_pic_set_idx, n); diff --git a/gst-libs/gst/codecparsers/gsth265parser.h b/gst-libs/gst/codecparsers/gsth265parser.h index 30ad695d37..619683adde 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.h +++ b/gst-libs/gst/codecparsers/gsth265parser.h @@ -1189,6 +1189,8 @@ struct _GstH265PredWeightTable * @header_size: the calculated size of the slice_header() in bits. * @n_emulation_prevention_bytes: number of emulation prevention bytes (EPB) * in this slice_header() + * @short_term_ref_pic_set_size: the calculated size of short_term_ref_pic_set() + * in bits. (Since: 1.18) */ struct _GstH265SliceHdr { @@ -1260,6 +1262,9 @@ struct _GstH265SliceHdr guint header_size; /* Number of emulation prevention bytes (EPB) in this slice_header() */ guint n_emulation_prevention_bytes; + + /* Size of short_term_ref_pic_set() in bits */ + guint short_term_ref_pic_set_size; }; struct _GstH265PicTiming