summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2014-08-08 14:08:19 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-08-11 15:31:45 +0300
commita9493a39859dcbe437f587fb36c9f8ec1dd0d317 (patch)
tree13d5d99feff27d1747ff87b7b97ccc6cacc9feea /ext
parent8ee4e198cc820d869da20c83a71246a6af50d1ae (diff)
opusenc: Unref pad template caps after usage
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734517
Diffstat (limited to 'ext')
-rw-r--r--ext/opus/gstopusenc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c
index 195d88fec..f9cf62444 100644
--- a/ext/opus/gstopusenc.c
+++ b/ext/opus/gstopusenc.c
@@ -717,6 +717,7 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
{
GstOpusEnc *enc;
GstCaps *caps;
+ GstCaps *tcaps;
GstCaps *peercaps = NULL;
GstCaps *intersect = NULL;
guint i;
@@ -734,8 +735,9 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
(GST_AUDIO_ENCODER_SINK_PAD (benc)));
}
- intersect = gst_caps_intersect (peercaps,
- gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SRC_PAD (benc)));
+ tcaps = gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SRC_PAD (benc));
+ intersect = gst_caps_intersect (peercaps, tcaps);
+ gst_caps_unref (tcaps);
gst_caps_unref (peercaps);
if (gst_caps_is_empty (intersect))
@@ -756,9 +758,8 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
gst_caps_unref (intersect);
- caps =
- gst_caps_copy (gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD
- (benc)));
+ caps = gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD (benc));
+ caps = gst_caps_make_writable (caps);
if (!allow_multistream) {
GValue range = { 0 };
g_value_init (&range, GST_TYPE_INT_RANGE);