mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
amcvideoenc: Avoid leaking copy of caps object
gst_pad_get_pad_template_caps() returns a reference which is unreferenced, so creating a copy using gst_caps_copy() results in a reference leak. Also remove the incorrect comment to avoid confusion in the future. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734533
This commit is contained in:
parent
7731f3b36e
commit
c1d5aa3da5
1 changed files with 1 additions and 4 deletions
|
@ -1288,11 +1288,8 @@ gst_amc_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
|
allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
|
||||||
if (!allowed_caps) {
|
if (!allowed_caps) {
|
||||||
GST_DEBUG_OBJECT (self, "... but no peer, using template caps");
|
GST_DEBUG_OBJECT (self, "... but no peer, using template caps");
|
||||||
/* we need to copy because get_allowed_caps returns a ref, and
|
|
||||||
* get_pad_template_caps doesn't */
|
|
||||||
allowed_caps =
|
allowed_caps =
|
||||||
gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_ENCODER_SRC_PAD
|
gst_pad_get_pad_template_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
|
||||||
(encoder)));
|
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (self, "chose caps %" GST_PTR_FORMAT, allowed_caps);
|
GST_DEBUG_OBJECT (self, "chose caps %" GST_PTR_FORMAT, allowed_caps);
|
||||||
allowed_caps = gst_caps_truncate (allowed_caps);
|
allowed_caps = gst_caps_truncate (allowed_caps);
|
||||||
|
|
Loading…
Reference in a new issue