diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c index 20e6cea50b..4e1d59597f 100644 --- a/gst-libs/gst/codecs/gsth264decoder.c +++ b/gst-libs/gst/codecs/gsth264decoder.c @@ -2207,7 +2207,7 @@ modify_ref_pic_list (GstH264Decoder * self, int list) case 2: /* (8-28) */ g_assert (num_ref_idx_lX_active_minus1 + 1 < 32); - pic = gst_h264_dpb_get_long_ref_by_pic_num (priv->dpb, + pic = gst_h264_dpb_get_long_ref_by_long_term_pic_num (priv->dpb, list_mod->value.long_term_pic_num); if (!pic) { GST_WARNING_OBJECT (self, "Malformed stream, no pic num %d", diff --git a/gst-libs/gst/codecs/gsth264picture.c b/gst-libs/gst/codecs/gsth264picture.c index 79a3359d08..54bc7602ad 100644 --- a/gst-libs/gst/codecs/gsth264picture.c +++ b/gst-libs/gst/codecs/gsth264picture.c @@ -333,16 +333,19 @@ gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num) } /** - * gst_h264_dpb_get_long_ref_by_pic_num: + * gst_h264_dpb_get_long_ref_by_long_term_pic_num: * @dpb: a #GstH264Dpb - * @pic_num: a picture number + * @pic_num: a long term picture number * - * Find a long term reference picture which has matching picture number + * Find a long term reference picture which has matching long term picture number * * Returns: (nullable) (transfer none): a #GstH264Picture + * + * Since: 1.20 */ GstH264Picture * -gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num) +gst_h264_dpb_get_long_ref_by_long_term_pic_num (GstH264Dpb * dpb, + gint long_term_pic_num) { gint i; @@ -352,11 +355,12 @@ gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num) GstH264Picture *picture = g_array_index (dpb->pic_list, GstH264Picture *, i); - if (picture->ref && picture->long_term && picture->pic_num == pic_num) + if (picture->ref && picture->long_term && + picture->long_term_pic_num == long_term_pic_num) return picture; } - GST_WARNING ("No long term reference picture for %d", pic_num); + GST_WARNING ("No long term reference picture for %d", long_term_pic_num); return NULL; } @@ -736,7 +740,7 @@ gst_h264_dpb_perform_memory_management_control_operation (GstH264Dpb * dpb, case 2: /* 8.2.5.4.2 Mark a long term reference picture as unused so it can be * removed if outputted */ - other = gst_h264_dpb_get_long_ref_by_pic_num (dpb, + other = gst_h264_dpb_get_long_ref_by_long_term_pic_num (dpb, ref_pic_marking->long_term_pic_num); if (other) { other->ref = FALSE; diff --git a/gst-libs/gst/codecs/gsth264picture.h b/gst-libs/gst/codecs/gsth264picture.h index ad90c21d8e..727c46da1c 100644 --- a/gst-libs/gst/codecs/gsth264picture.h +++ b/gst-libs/gst/codecs/gsth264picture.h @@ -180,8 +180,8 @@ GstH264Picture * gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num); GST_CODECS_API -GstH264Picture * gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb, - gint pic_num); +GstH264Picture * gst_h264_dpb_get_long_ref_by_long_term_pic_num (GstH264Dpb * dpb, + gint long_term_pic_num); GST_CODECS_API GstH264Picture * gst_h264_dpb_get_lowest_frame_num_short_ref (GstH264Dpb * dpb);