mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
playsink: Fix volume element leak
In case sink implements a streamvolume interface, volume element is being got from the sink. But this is transfer full. So the memory should be freed before setting it to NULL. This was resulting in major memory leaks https://bugzilla.gnome.org/show_bug.cgi?id=755867
This commit is contained in:
parent
4fe12c1b09
commit
b424bc2e4f
1 changed files with 6 additions and 0 deletions
|
@ -3472,6 +3472,8 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
|
|||
|
||||
activate_chain (GST_PLAY_CHAIN (playsink->audiochain), FALSE);
|
||||
disconnect_audio_chain (playsink->audiochain, playsink);
|
||||
if (playsink->audiochain->volume)
|
||||
gst_object_unref (playsink->audiochain->volume);
|
||||
playsink->audiochain->volume = NULL;
|
||||
if (playsink->audiochain->ts_offset)
|
||||
gst_object_unref (playsink->audiochain->ts_offset);
|
||||
|
@ -3580,6 +3582,8 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
|
|||
|
||||
if (playsink->audiochain->sink_volume) {
|
||||
disconnect_audio_chain (playsink->audiochain, playsink);
|
||||
if (playsink->audiochain->volume)
|
||||
gst_object_unref (playsink->audiochain->volume);
|
||||
playsink->audiochain->volume = NULL;
|
||||
if (playsink->audiochain->ts_offset)
|
||||
gst_object_unref (playsink->audiochain->ts_offset);
|
||||
|
@ -4786,6 +4790,8 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
/* remove our links to the volume elements when they were
|
||||
* provided by a sink */
|
||||
disconnect_audio_chain (playsink->audiochain, playsink);
|
||||
if (playsink->audiochain->volume)
|
||||
gst_object_unref (playsink->audiochain->volume);
|
||||
playsink->audiochain->volume = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue