summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-08-12 13:18:34 +0000
committerLennart Poettering <lennart@poettering.net>2006-08-12 13:18:34 +0000
commitc86890d5e794aa5b4b3e39796c705b5922877dfe (patch)
tree9df7e4f2723323f41b5275e46aa7eb53b17aab80 /src/modules
parent7fa074480687dff06723b7078c8146aae5eec61a (diff)
downloadpulseaudio-c86890d5e794aa5b4b3e39796c705b5922877dfe.tar.gz
* only load an OSS driver for the first device of a sound card, similar to what is done for ALSA.
* fix a mem leak git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1217 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-hal-detect.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index 54d139ecb..825fa96ce 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -192,26 +192,33 @@ static dbus_bool_t hal_device_is_oss_pcm(LibHalContext *ctx, const char *udi,
DBusError *error)
{
dbus_bool_t rv = FALSE;
- char* device;
- char* type;
+ char* type, *device_file = NULL;
+ int device;
type = libhal_device_get_property_string(ctx, udi, "oss.type", error);
if (!type || dbus_error_is_set(error))
return FALSE;
-
+
if (!strcmp(type, "pcm")) {
- device = libhal_device_get_property_string(ctx, udi, "oss.device_file",
+ char *e;
+
+ device = libhal_device_get_property_int(ctx, udi, "oss.device", error);
+ if (dbus_error_is_set(error) || device != 0)
+ goto exit;
+
+ device_file = libhal_device_get_property_string(ctx, udi, "oss.device_file",
error);
- if (!device || dbus_error_is_set(error))
+ if (!device_file || dbus_error_is_set(error))
goto exit;
/* hack to ignore /dev/audio style devices */
- if ((device = strrchr(device, '/')))
- rv = (pa_startswith(device + 1, "audio")) ? FALSE : TRUE;
+ if ((e = strrchr(device_file, '/')))
+ rv = !pa_startswith(e + 1, "audio");
}
exit:
libhal_free_string(type);
+ libhal_free_string(device_file);
return rv;
}