mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
avoid duplicate loading of modules
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1613 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
1e5ca51016
commit
10b135a4bf
1 changed files with 22 additions and 15 deletions
|
|
@ -299,6 +299,7 @@ static struct device* hal_device_add(struct userdata *u, const char *udi) {
|
||||||
|
|
||||||
pa_assert(u);
|
pa_assert(u);
|
||||||
pa_assert(u->capability);
|
pa_assert(u->capability);
|
||||||
|
pa_assert(!pa_hashmap_get(u->devices, udi));
|
||||||
|
|
||||||
#ifdef HAVE_ALSA
|
#ifdef HAVE_ALSA
|
||||||
if (strcmp(u->capability, CAPABILITY_ALSA) == 0)
|
if (strcmp(u->capability, CAPABILITY_ALSA) == 0)
|
||||||
|
|
@ -374,11 +375,13 @@ static dbus_bool_t device_has_capability(LibHalContext *context, const char *udi
|
||||||
static void device_added_time_cb(pa_mainloop_api *ea, pa_time_event *ev, const struct timeval *tv, void *userdata) {
|
static void device_added_time_cb(pa_mainloop_api *ea, pa_time_event *ev, const struct timeval *tv, void *userdata) {
|
||||||
DBusError error;
|
DBusError error;
|
||||||
struct timerdata *td = userdata;
|
struct timerdata *td = userdata;
|
||||||
int b;
|
|
||||||
struct device *d;
|
|
||||||
|
|
||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
|
|
||||||
|
if (!pa_hashmap_get(td->u->devices, td->udi)) {
|
||||||
|
int b;
|
||||||
|
struct device *d;
|
||||||
|
|
||||||
b = libhal_device_exists(td->u->context, td->udi, &error);
|
b = libhal_device_exists(td->u->context, td->udi, &error);
|
||||||
|
|
||||||
if (dbus_error_is_set(&error)) {
|
if (dbus_error_is_set(&error)) {
|
||||||
|
|
@ -392,6 +395,7 @@ static void device_added_time_cb(pa_mainloop_api *ea, pa_time_event *ev, const s
|
||||||
pa_scache_play_item_by_name(td->u->core, "pulse-hotplug", d->sink_name, PA_VOLUME_NORM, 0);
|
pa_scache_play_item_by_name(td->u->core, "pulse-hotplug", d->sink_name, PA_VOLUME_NORM, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pa_xfree(td->udi);
|
pa_xfree(td->udi);
|
||||||
pa_xfree(td);
|
pa_xfree(td);
|
||||||
|
|
@ -407,6 +411,9 @@ static void device_added_cb(LibHalContext *context, const char *udi) {
|
||||||
|
|
||||||
pa_assert_se(u = libhal_ctx_get_user_data(context));
|
pa_assert_se(u = libhal_ctx_get_user_data(context));
|
||||||
|
|
||||||
|
if (pa_hashmap_get(u->devices, udi))
|
||||||
|
return;
|
||||||
|
|
||||||
pa_log_debug("HAL Device added: %s", udi);
|
pa_log_debug("HAL Device added: %s", udi);
|
||||||
|
|
||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue