directsoundsink: Check device property and fail if device can't be found

Don't use default if a specific device is set but it can't be found.

https://bugzilla.gnome.org/show_bug.cgi?id=759452
This commit is contained in:
Thomas Roos 2015-12-14 14:55:12 +01:00 committed by Sebastian Dröge
parent fb5a5c069c
commit adb5efaf8a

View file

@ -430,8 +430,15 @@ gst_directsound_sink_open (GstAudioSink * asink)
dsoundsink = GST_DIRECTSOUND_SINK (asink);
if (dsoundsink->device_id)
if (dsoundsink->device_id) {
lpGuid = string_to_guid (dsoundsink->device_id);
if (lpGuid == NULL) {
GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
("gst_directsound_sink_open: device set, but guid not found: %s",
dsoundsink->device_id), (NULL));
return FALSE;
}
}
/* create and initialize a DirecSound object */
if (FAILED (hRes = DirectSoundCreate (lpGuid, &dsoundsink->pDS, NULL))) {