diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 7703c12ba4..00837591bc 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1960,13 +1960,11 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec) templcaps = gst_pad_get_pad_template_caps (dec->srcpad); caps = gst_pad_peer_query_caps (dec->srcpad, templcaps); - if (caps) { + if (caps) gst_caps_unref (templcaps); - templcaps = NULL; - } else { + else caps = templcaps; - templcaps = NULL; - } + templcaps = NULL; if (!caps || gst_caps_is_empty (caps) || gst_caps_is_any (caps)) goto caps_error; diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 992560fc02..d13484a9dd 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1098,13 +1098,11 @@ gst_video_decoder_negotiate_default_caps (GstVideoDecoder * decoder) templcaps = gst_pad_get_pad_template_caps (decoder->srcpad); caps = gst_pad_peer_query_caps (decoder->srcpad, templcaps); - if (caps) { + if (caps) gst_caps_unref (templcaps); - templcaps = NULL; - } else { + else caps = templcaps; - templcaps = NULL; - } + templcaps = NULL; if (!caps || gst_caps_is_empty (caps) || gst_caps_is_any (caps)) goto caps_error;