opusenc: Unref pad template caps after usage

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734517
This commit is contained in:
Sebastian Rasmussen 2014-08-08 14:08:19 +02:00 committed by Sebastian Dröge
parent 8ee4e198cc
commit a9493a3985

View file

@ -717,6 +717,7 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
{ {
GstOpusEnc *enc; GstOpusEnc *enc;
GstCaps *caps; GstCaps *caps;
GstCaps *tcaps;
GstCaps *peercaps = NULL; GstCaps *peercaps = NULL;
GstCaps *intersect = NULL; GstCaps *intersect = NULL;
guint i; guint i;
@ -734,8 +735,9 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
(GST_AUDIO_ENCODER_SINK_PAD (benc))); (GST_AUDIO_ENCODER_SINK_PAD (benc)));
} }
intersect = gst_caps_intersect (peercaps, tcaps = gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SRC_PAD (benc));
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); gst_caps_unref (peercaps);
if (gst_caps_is_empty (intersect)) if (gst_caps_is_empty (intersect))
@ -756,9 +758,8 @@ gst_opus_enc_sink_getcaps (GstAudioEncoder * benc, GstCaps * filter)
gst_caps_unref (intersect); gst_caps_unref (intersect);
caps = caps = gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD (benc));
gst_caps_copy (gst_pad_get_pad_template_caps (GST_AUDIO_ENCODER_SINK_PAD caps = gst_caps_make_writable (caps);
(benc)));
if (!allow_multistream) { if (!allow_multistream) {
GValue range = { 0 }; GValue range = { 0 };
g_value_init (&range, GST_TYPE_INT_RANGE); g_value_init (&range, GST_TYPE_INT_RANGE);