Don't assume that device reservation is enabled.
authorColin Guthrie <cguthrie@mandriva.org>
Sat, 28 Feb 2009 23:45:02 +0000 (23:45 +0000)
committerColin Guthrie <cguthrie@mandriva.org>
Sat, 28 Feb 2009 23:51:12 +0000 (23:51 +0000)
In the case when the alsa 'device' is not a physical card, it wont have an index and thus
the reservation name will be NULL and therefore we will not initialise the reservation system.

Fixes #498

src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index 0aef1bd..708e020 100644 (file)
@@ -148,7 +148,7 @@ static void reserve_update(struct userdata *u) {
     const char *description;
     pa_assert(u);
 
-    if (!u->sink)
+    if (!u->sink || !u->reserve)
         return;
 
     if ((description = pa_proplist_gets(u->sink->proplist, PA_PROP_DEVICE_DESCRIPTION)))
index 671df3f..4321c7f 100644 (file)
@@ -146,7 +146,7 @@ static void reserve_update(struct userdata *u) {
     const char *description;
     pa_assert(u);
 
-    if (!u->source)
+    if (!u->source || !u->reserve)
         return;
 
     if ((description = pa_proplist_gets(u->source->proplist, PA_PROP_DEVICE_DESCRIPTION)))