a2dpsink: unref avdtpsink if state transition failed

If for some reason the avdtpsink element can't go READY then the
gsta2dpsink can't either and so should release the ressources it
allocates when trying to do so.

Fix a leak with the generic/states test.

https://bugzilla.gnome.org/show_bug.cgi?id=767161
This commit is contained in:
Guillaume Desmottes 2016-05-18 12:48:48 +03:00 committed by Tim-Philipp Müller
parent f615a84646
commit 007c7f9b78

View file

@ -288,6 +288,9 @@ gst_a2dp_sink_change_state (GstElement * element, GstStateChange transition)
self->autoconnect, NULL);
ret = gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_READY);
if (ret == GST_STATE_CHANGE_FAILURE) {
g_clear_object (&self->sink);
}
break;
default:
break;