diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2012-06-04 17:44:20 +0300 |
---|---|---|
committer | Jaska Uimonen <jaska.uimonen@intel.com> | 2013-01-24 09:29:36 +0200 |
commit | 8ea12937cebed11be9bbd714fa9ae35562197c5d (patch) | |
tree | 33bab08e4e81b46ab22bf9a400547b93753300d6 | |
parent | ea7adaf44b0f7d6bc0625b462d0d1e587501dbde (diff) | |
download | pulseaudio-panda-8ea12937cebed11be9bbd714fa9ae35562197c5d.tar.gz pulseaudio-panda-8ea12937cebed11be9bbd714fa9ae35562197c5d.tar.bz2 pulseaudio-panda-8ea12937cebed11be9bbd714fa9ae35562197c5d.zip |
device-port: Create the profiles hashmap at initialization.
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.
-rw-r--r-- | src/modules/alsa/alsa-mixer.c | 1 | ||||
-rw-r--r-- | src/pulsecore/device-port.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 8b54f751..260573c4 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -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; diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c index 50c99b8f..5870913f 100644 --- a/src/pulsecore/device-port.c +++ b/src/pulsecore/device-port.c @@ -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(); |