]> code.delx.au - pulseaudio/commitdiff
device-port: Create the profiles hashmap at initialization.
authorTanu Kaskinen <tanuk@iki.fi>
Mon, 4 Jun 2012 14:44:20 +0000 (17:44 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 8 Jun 2012 13:28:22 +0000 (16:28 +0300)
I doesn't make sense to require all callers of
pa_device_port_new() to create the hashmap themselves. There
are and there will be no cases where a port without any
profiles would be desired.

src/modules/alsa/alsa-mixer.c
src/pulsecore/device-port.c

index 8b54f751d115790afa19b05ed6fda3dcf770add2..260573c41971831531b9dfada3fd37ffac748ab0 100644 (file)
@@ -4509,7 +4509,6 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports,
         p = pa_device_port_new(core, name, description, sizeof(pa_alsa_port_data));
         pa_assert(p);
         pa_hashmap_put(ports, p->name, p);
-        p->profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
 
         data = PA_DEVICE_PORT_DATA(p);
         data->path = path;
index 50c99b8f238aa13b65d828a45a131cb144bd1ec3..5870913f28a6307f52e40225b7608432d9337d57 100644 (file)
@@ -94,7 +94,7 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des
     p->core = c;
     p->priority = 0;
     p->available = PA_PORT_AVAILABLE_UNKNOWN;
-    p->profiles = NULL;
+    p->profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
     p->is_input = FALSE;
     p->is_output = FALSE;
     p->proplist = pa_proplist_new();