diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2007-03-01 01:48:59 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2007-03-01 01:48:59 +0000 |
commit | 16490dc0cf0799493ca99a061264d7cc270eb3f4 (patch) | |
tree | b29a1ddc768ef659030788a1ebcbe8ddc62b4747 /ext/hal/gsthalaudiosrc.c | |
parent | 9597bb3f079b6ad90ad11136c20473fe1da40428 (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/gsthalaudiosrc.c')
-rw-r--r-- | ext/hal/gsthalaudiosrc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/hal/gsthalaudiosrc.c b/ext/hal/gsthalaudiosrc.c index f57e963e..ed887544 100644 --- a/ext/hal/gsthalaudiosrc.c +++ b/ext/hal/gsthalaudiosrc.c @@ -164,7 +164,11 @@ do_toggle_element (GstHalAudioSrc * src) } GST_DEBUG_OBJECT (src, "Creating new kid"); - if (!(src->kid = gst_hal_get_audio_src (src->udi))) { + if (!src->udi) { + GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS, (NULL), + ("No UDI set for device")); + return FALSE; + } else if (!(src->kid = gst_hal_get_audio_src (src->udi))) { GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS, (NULL), ("Failed to render audio source from Hal")); return FALSE; |