mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: use defines for default sink/source
This commit is contained in:
parent
c3c1a1184c
commit
0fba936b06
2 changed files with 10 additions and 6 deletions
|
|
@ -56,6 +56,10 @@
|
|||
#define MONITOR_FLAG (1u << 16)
|
||||
#define EXTENSION_FLAG (1u << 17)
|
||||
|
||||
#define DEFAULT_SINK "@DEFAULT_SINK@"
|
||||
#define DEFAULT_SOURCE "@DEFAULT_SOURCE@"
|
||||
#define DEFAULT_MONITOR "@DEFAULT_MONITOR@"
|
||||
|
||||
enum error_code {
|
||||
ERR_OK = 0, /**< No error */
|
||||
ERR_ACCESS, /**< Access failure */
|
||||
|
|
|
|||
|
|
@ -2726,11 +2726,11 @@ static const char *get_default(struct client *client, bool sink)
|
|||
if (sink) {
|
||||
sel.type = object_is_sink;
|
||||
sel.id = client->default_sink;
|
||||
def = "@DEFAULT_SINK@";
|
||||
def = DEFAULT_SINK;
|
||||
} else {
|
||||
sel.type = object_is_source;
|
||||
sel.id = client->default_source;
|
||||
def = "@DEFAULT_SOURCE@";
|
||||
def = DEFAULT_SOURCE;
|
||||
}
|
||||
sel.accumulate = select_best;
|
||||
|
||||
|
|
@ -2754,10 +2754,10 @@ static struct pw_manager_object *find_device(struct client *client,
|
|||
|
||||
if (sink) {
|
||||
sel.type = object_is_sink;
|
||||
def = "@DEFAULT_SINK@";
|
||||
def = DEFAULT_SINK;
|
||||
} else {
|
||||
sel.type = object_is_source;
|
||||
def = "@DEFAULT_SOURCE@";
|
||||
def = DEFAULT_SOURCE;
|
||||
}
|
||||
if (sel.value != NULL && strcmp(sel.value, def) == 0)
|
||||
sel.value = get_default(client, sink);
|
||||
|
|
@ -3828,13 +3828,13 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
|
|||
sel.type = object_is_sink;
|
||||
sel.key = PW_KEY_NODE_NAME;
|
||||
fill_func = fill_sink_info;
|
||||
def = "@DEFAULT_SINK@";
|
||||
def = DEFAULT_SINK;
|
||||
break;
|
||||
case COMMAND_GET_SOURCE_INFO:
|
||||
sel.type = object_is_source_or_monitor;
|
||||
sel.key = PW_KEY_NODE_NAME;
|
||||
fill_func = fill_source_info;
|
||||
def = "@DEFAULT_SOURCE@";
|
||||
def = DEFAULT_SOURCE;
|
||||
break;
|
||||
case COMMAND_GET_SINK_INPUT_INFO:
|
||||
sel.type = object_is_sink_input;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue