summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2020-05-08 17:56:48 -0400
committerNicolas Dufresne <nicolas@ndufresne.ca>2020-05-19 16:57:08 +0000
commitf8736626a99bdcb6e9490487dca133236d5aecad (patch)
tree293df590c14c9e8ab185e7c66ca84fe3d02639a4 /gst-libs
parenta20147f255e5e0c11366b9fffcbb6334b0b3a06c (diff)
downloadgstreamer-plugins-bad-f8736626a99bdcb6e9490487dca133236d5aecad.tar.gz
codecs: h264decoder: Make get_long_ref_by_pic_num() transfer none
We don't use the extra reference, so let's just avoid the extra ref/unref. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gsth264decoder.c1
-rw-r--r--gst-libs/gst/codecs/gsth264picture.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c
index 8c9371bf5..0e783d577 100644
--- a/gst-libs/gst/codecs/gsth264decoder.c
+++ b/gst-libs/gst/codecs/gsth264decoder.c
@@ -1269,7 +1269,6 @@ gst_h264_decoder_handle_memory_management_opt (GstH264Decoder * self,
ref_pic_marking->long_term_pic_num);
if (to_mark) {
to_mark->ref = FALSE;
- gst_h264_picture_unref (to_mark);
} else {
GST_WARNING_OBJECT (self, "Invalid long term ref pic num to unmark");
return FALSE;
diff --git a/gst-libs/gst/codecs/gsth264picture.c b/gst-libs/gst/codecs/gsth264picture.c
index ceb8694e3..4678050db 100644
--- a/gst-libs/gst/codecs/gsth264picture.c
+++ b/gst-libs/gst/codecs/gsth264picture.c
@@ -345,7 +345,7 @@ gst_h264_dpb_get_short_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num)
*
* Find a long term reference picture which has matching picture number
*
- * Returns: (nullable) (transfer full): a #GstH264Picture
+ * Returns: (nullable) (transfer none): a #GstH264Picture
*/
GstH264Picture *
gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num)
@@ -359,7 +359,7 @@ gst_h264_dpb_get_long_ref_by_pic_num (GstH264Dpb * dpb, gint pic_num)
g_array_index (dpb->pic_list, GstH264Picture *, i);
if (picture->ref && picture->long_term && picture->pic_num == pic_num)
- return gst_h264_picture_ref (picture);
+ return picture;
}
GST_WARNING ("No long term reference picture for %d", pic_num);