summaryrefslogtreecommitdiffstats
path: root/ext/hal/gsthalaudiosink.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-03-01 01:48:59 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-03-01 01:48:59 +0000
commit16490dc0cf0799493ca99a061264d7cc270eb3f4 (patch)
treeb29a1ddc768ef659030788a1ebcbe8ddc62b4747 /ext/hal/gsthalaudiosink.c
parent9597bb3f079b6ad90ad11136c20473fe1da40428 (diff)
ext/hal/: Check if the device UDI is set before trying to query HAL about it and give a useful error message if it wa...
Original commit message from CVS: * ext/hal/gsthalaudiosink.c: (do_toggle_element): * ext/hal/gsthalaudiosrc.c: (do_toggle_element): Check if the device UDI is set before trying to query HAL about it and give a useful error message if it wasn't set. * ext/hal/hal.c: (gst_hal_get_string): Don't query HAL for NULL UDIs. Passing NULL as UDI to HAL gives an assertion failure in D-Bus when running with DBUS_FATAL_WARNINGS=1.
Diffstat (limited to 'ext/hal/gsthalaudiosink.c')
-rw-r--r--ext/hal/gsthalaudiosink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/hal/gsthalaudiosink.c b/ext/hal/gsthalaudiosink.c
index ea3c4066..1b941aa0 100644
--- a/ext/hal/gsthalaudiosink.c
+++ b/ext/hal/gsthalaudiosink.c
@@ -162,7 +162,11 @@ do_toggle_element (GstHalAudioSink * sink)
}
GST_DEBUG_OBJECT (sink, "Creating new kid");
- if (!(sink->kid = gst_hal_get_audio_sink (sink->udi))) {
+ if (!sink->udi) {
+ GST_ELEMENT_ERROR (sink, LIBRARY, SETTINGS, (NULL),
+ ("No UDI set for device"));
+ return FALSE;
+ } else if (!(sink->kid = gst_hal_get_audio_sink (sink->udi))) {
GST_ELEMENT_ERROR (sink, LIBRARY, SETTINGS, (NULL),
("Failed to render audio sink from Hal"));
return FALSE;