diff options
author | poljar (Damir Jelić) <poljarinho@gmail.com> | 2013-03-28 12:05:11 +0100 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-06-04 00:38:39 +0530 |
commit | 80b0e285a5a2651f1cf43af32db3b0c583f99fda (patch) | |
tree | 1f830e4637c695ccb44314e2ff85fd7786baad05 /src/modules/alsa/alsa-mixer.c | |
parent | 23f88ecb84ef5ecccbdd45fbab55e52f602e4795 (diff) |
device-port: Introduce pa_device_port_new_data
Port creation is now slightly different. It is now similar to how
other objects are created (e.g. sinks/sources/cards).
This should become more useful in the future when we move more stuff to
the ports.
Functionally nothing has changed.
Diffstat (limited to 'src/modules/alsa/alsa-mixer.c')
-rw-r--r-- | src/modules/alsa/alsa-mixer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 252858b92..be9ee4e20 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -4496,11 +4496,15 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */ if (!p) { pa_alsa_port_data *data; - pa_direction_t direction; + pa_device_port_new_data port_data; - direction = path->direction == PA_ALSA_DIRECTION_OUTPUT ? PA_DIRECTION_OUTPUT : PA_DIRECTION_INPUT; + pa_device_port_new_data_init(&port_data); + pa_device_port_new_data_set_name(&port_data, name); + pa_device_port_new_data_set_description(&port_data, description); + pa_device_port_new_data_set_direction(&port_data, path->direction == PA_ALSA_DIRECTION_OUTPUT ? PA_DIRECTION_OUTPUT : PA_DIRECTION_INPUT); - p = pa_device_port_new(core, name, description, direction, sizeof(pa_alsa_port_data)); + p = pa_device_port_new(core, &port_data, sizeof(pa_alsa_port_data)); + pa_device_port_new_data_done(&port_data); pa_assert(p); pa_hashmap_put(ports, p->name, p); pa_proplist_update(p->proplist, PA_UPDATE_REPLACE, path->proplist); |