]> code.delx.au - pulseaudio/commitdiff
device-manager: Remove unneeded logic for checking for and (un)loading module-stream...
authorColin Guthrie <cguthrie@mandriva.org>
Sun, 20 Sep 2009 16:33:18 +0000 (17:33 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Thu, 1 Oct 2009 08:08:30 +0000 (09:08 +0100)
src/modules/module-device-manager.c

index 4c4e3f0b77893fac1d5afcafb503e8bfa8798e1a..38b4c025f39028f0fdae0921fe8a701c18cd04da 100644 (file)
@@ -93,8 +93,6 @@ struct userdata {
     pa_bool_t on_hotplug;
     pa_bool_t on_rescue;
     pa_bool_t role_device_priority_routing;
-    pa_bool_t stream_restore_used;
-    pa_bool_t checked_stream_restore;
 };
 
 #define ENTRY_VERSION 1
@@ -733,40 +731,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
         if (pa_tagstruct_get_boolean(t, &enable) < 0)
             goto fail;
 
-        /* If this is the first run, check for stream restore module */
-        if (!u->checked_stream_restore) {
-            u->checked_stream_restore = TRUE;
-
-            for (module = pa_idxset_first(u->core->modules, &idx); module; module = pa_idxset_next(u->core->modules, &idx)) {
-                if (strcmp(module->name, "module-stream-restore") == 0) {
-                    pa_log_debug("Detected module-stream-restore is currently in use");
-                    u->stream_restore_used = TRUE;
-                    sridx = module->index;
-                }
-            }
-        }
-
         u->role_device_priority_routing = enable;
-        if (enable) {
-            if (u->stream_restore_used) {
-                if (PA_INVALID_INDEX == sridx) {
-                    /* As a shortcut on first load, we have sridx filled in, but otherwise we search for it. */
-                    for (module = pa_idxset_first(u->core->modules, &idx); module; module = pa_idxset_next(u->core->modules, &idx)) {
-                        if (strcmp(module->name, "module-stream-restore") == 0) {
-                            sridx = module->index;
-                        }
-                    }
-                }
-                if (PA_INVALID_INDEX != sridx) {
-                    pa_log_debug("Unloading module-stream-restore to enable role-based device-priority routing");
-                    pa_module_unload_request_by_index(u->core, sridx, TRUE);
-                }
-            }
-        } else if (u->stream_restore_used) {
-            /* We want to reload module-stream-restore */
-            if (!pa_module_load(u->core, "module-stream-restore", ""))
-                pa_log_warn("Failed to load module-stream-restore while disabling role-based device-priority routing");
-        }
 
         break;
     }