mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-11 13:30:02 -05:00
device-port: Add preferred_profile field to pa_device_port
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
2a71fd7597
commit
b1d9b4f62c
2 changed files with 13 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "device-port.h"
|
||||
#include <pulsecore/card.h>
|
||||
#include <pulsecore/core-util.h>
|
||||
|
||||
PA_DEFINE_PUBLIC_CLASS(pa_device_port, pa_object);
|
||||
|
||||
|
|
@ -65,6 +66,15 @@ void pa_device_port_new_data_done(pa_device_port_new_data *data) {
|
|||
pa_xfree(data->description);
|
||||
}
|
||||
|
||||
void pa_device_port_set_preferred_profile(pa_device_port *p, const char *new_pp) {
|
||||
pa_assert(p);
|
||||
|
||||
if (!pa_safe_streq(p->preferred_profile, new_pp)) {
|
||||
pa_xfree(p->preferred_profile);
|
||||
p->preferred_profile = pa_xstrdup(new_pp);
|
||||
}
|
||||
}
|
||||
|
||||
void pa_device_port_set_available(pa_device_port *p, pa_available_t status) {
|
||||
pa_assert(p);
|
||||
|
||||
|
|
@ -100,6 +110,7 @@ static void device_port_free(pa_object *o) {
|
|||
if (p->profiles)
|
||||
pa_hashmap_free(p->profiles);
|
||||
|
||||
pa_xfree(p->preferred_profile);
|
||||
pa_xfree(p->name);
|
||||
pa_xfree(p->description);
|
||||
pa_xfree(p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue