SVN commit 799841 by mkretz: try all possible devices to determine whether a sink is useful M +9 -3 devicemanager.cpp --- trunk/kdereview/phonon/gstreamer/devicemanager.cpp #799840:799841 @@ -127,9 +127,15 @@ if (gst_element_set_state(element, GST_STATE_READY) == GST_STATE_CHANGE_SUCCESS) return true; - // FIXME: if the above failed that might only mean that some property first has to be - // set/changed before it will go the READY. E.g. the alsasink only probes the "default" device. - // If that fails for some reason it doesn't indicate a fatal error + const QList &list = GstHelper::extractProperties(element, "device"); + foreach (const QByteArray &gstId, list) { + GstHelper::setProperty(element, "device", gstId); + if (gst_element_set_state(element, GST_STATE_READY) == GST_STATE_CHANGE_SUCCESS) { + return true; + } + } + // FIXME: the above can still fail for a valid alsasink because list only contains entries of + // the form "hw:X,Y". Would be better to use "default:X" or "dmix:X,Y" gst_element_set_state(element, GST_STATE_NULL); return false;