audioencoder: don't unref caps parameter

Fix refcounting on incomming caps to make sure we don't unref it too much.
This commit is contained in:
Wim Taymans 2012-02-03 09:48:22 +01:00
parent c1aa6e835e
commit fe3e9b90dd

View file

@ -1163,7 +1163,8 @@ gst_audio_encoder_proxy_getcaps (GstAudioEncoder * enc, GstCaps * caps)
/* we want to be able to communicate to upstream elements like audioconvert
* and audioresample any rate/channel restrictions downstream (e.g. muxer
* only accepting certain sample rates) */
templ_caps = caps ? caps : gst_pad_get_pad_template_caps (enc->sinkpad);
templ_caps =
caps ? gst_caps_ref (caps) : gst_pad_get_pad_template_caps (enc->sinkpad);
allowed = gst_pad_get_allowed_caps (enc->srcpad);
if (!allowed || gst_caps_is_empty (allowed) || gst_caps_is_any (allowed)) {
fcaps = gst_caps_copy (templ_caps);