summaryrefslogtreecommitdiff
path: root/sys/directsound
diff options
context:
space:
mode:
authorThomas Roos <thomas.roos@industronic.de>2015-12-14 14:55:12 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-12-14 15:48:40 +0100
commitadb5efaf8a9a5b4b6590c637f9054f5df8f2b2a1 (patch)
tree349e5e090e7e62f71b234922cf05ad9713ef931a /sys/directsound
parentfb5a5c069ce32b8d0915251f9e3cc8000a23d8ec (diff)
downloadgstreamer-plugins-good-adb5efaf8a9a5b4b6590c637f9054f5df8f2b2a1.tar.gz
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
Diffstat (limited to 'sys/directsound')
-rw-r--r--sys/directsound/gstdirectsoundsink.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/directsound/gstdirectsoundsink.c b/sys/directsound/gstdirectsoundsink.c
index a4f0bded8..6f05d8041 100644
--- a/sys/directsound/gstdirectsoundsink.c
+++ b/sys/directsound/gstdirectsoundsink.c
@@ -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))) {