udev: make sure we get events only for sound devices
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jan 2010 18:41:44 +0000 (19:41 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Tue, 9 Feb 2010 22:32:14 +0000 (22:32 +0000)
src/modules/module-udev-detect.c

index dfd13ee..9b1fdb0 100644 (file)
@@ -639,6 +639,11 @@ int pa__init(pa_module *m) {
         goto fail;
     }
 
+    if (udev_monitor_filter_add_match_subsystem_devtype(u->monitor, "sound", NULL) < 0) {
+        pa_log("Failed to subscribe to sound devices.");
+        goto fail;
+    }
+
     errno = 0;
     if (udev_monitor_enable_receiving(u->monitor) < 0) {
         pa_log("Failed to enable monitor: %s", pa_cstrerror(errno));