summaryrefslogtreecommitdiff
path: root/gst/transcode
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2020-02-25 21:03:06 +0530
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-02-26 03:23:20 +0000
commit54d8360baa1698b5a4c075df83c84037d2d6b6ae (patch)
treeee0377b6e08781ca2c9d702a493b546b5fb4d39a /gst/transcode
parent91a033a85e2b3016cf978920a843607327a422bc (diff)
downloadgstreamer-plugins-bad-54d8360baa1698b5a4c075df83c84037d2d6b6ae.tar.gz
transcodebin: fix caps leak
encodecaps was leaked if the profile has restrictions.
Diffstat (limited to 'gst/transcode')
-rw-r--r--gst/transcode/gsttranscodebin.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/transcode/gsttranscodebin.c b/gst/transcode/gsttranscodebin.c
index 51812f41d..e69897a42 100644
--- a/gst/transcode/gsttranscodebin.c
+++ b/gst/transcode/gsttranscodebin.c
@@ -293,14 +293,16 @@ make_decodebin (GstTranscodeBin * self)
gst_encoding_container_profile_get_profiles
(GST_ENCODING_CONTAINER_PROFILE (self->profile)); tmp;
tmp = tmp->next) {
- GstCaps *encodecaps = gst_encoding_profile_get_format (tmp->data);
GstCaps *restrictions =
gst_encoding_profile_get_restriction (tmp->data);
- if (!restrictions)
+ if (!restrictions) {
+ GstCaps *encodecaps = gst_encoding_profile_get_format (tmp->data);
+
gst_caps_append (decodecaps, encodecaps);
- else
+ } else {
gst_caps_unref (restrictions);
+ }
}
}
g_object_set (self->decodebin, "caps", decodecaps, NULL);