1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 03:27:40 +01:00

Fix error when unref'ing cdda element after failing to read CD.

This commit is contained in:
John Maguire 2011-06-15 19:28:25 +00:00
parent 7fca5d37dc
commit 25587286b2

View File

@ -110,9 +110,10 @@ SongLoader::Result SongLoader::LoadAudioCD() {
}
// Change the element's state to ready and paused, to be able to query it
if (gst_element_set_state(cdda, GST_STATE_READY) == GST_STATE_CHANGE_FAILURE
|| gst_element_set_state(cdda, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) {
if (gst_element_set_state(cdda, GST_STATE_READY) == GST_STATE_CHANGE_FAILURE ||
gst_element_set_state(cdda, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) {
qLog(Error) << "Error while changing CDDA GstElement's state";
gst_element_set_state(cdda, GST_STATE_NULL);
gst_object_unref(GST_OBJECT(cdda));
return Error;
}