mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
audiovisualizer: fix caps leaks
Fix leak of caps event and of caps objects when setting caps on sink and src pads
This commit is contained in:
parent
cf76aa2a1d
commit
c5ef1bee73
1 changed files with 3 additions and 0 deletions
|
@ -766,12 +766,14 @@ gst_audio_visualizer_src_setcaps (GstAudioVisualizer * scope, GstCaps * caps)
|
||||||
|
|
||||||
/* find a pool for the negotiated caps now */
|
/* find a pool for the negotiated caps now */
|
||||||
res = gst_audio_visualizer_do_bufferpool (scope, caps);
|
res = gst_audio_visualizer_do_bufferpool (scope, caps);
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
wrong_caps:
|
wrong_caps:
|
||||||
{
|
{
|
||||||
|
gst_caps_unref (caps);
|
||||||
GST_DEBUG_OBJECT (scope, "error parsing caps");
|
GST_DEBUG_OBJECT (scope, "error parsing caps");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1263,6 +1265,7 @@ gst_audio_visualizer_sink_event (GstPad * pad, GstObject * parent,
|
||||||
|
|
||||||
gst_event_parse_caps (event, &caps);
|
gst_event_parse_caps (event, &caps);
|
||||||
res = gst_audio_visualizer_sink_setcaps (scope, caps);
|
res = gst_audio_visualizer_sink_setcaps (scope, caps);
|
||||||
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
|
|
Loading…
Reference in a new issue