mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
stream: fix connect by name
Look up the node id for the given device name and use that to connect.
This commit is contained in:
parent
6df567e6d4
commit
520a9831e7
3 changed files with 12 additions and 3 deletions
|
|
@ -157,6 +157,7 @@ static void sink_callback(struct sink_data *d)
|
|||
ii[0].encoding = PA_ENCODING_PCM;
|
||||
ii[0].plist = pa_proplist_new();
|
||||
ip[0] = ii;
|
||||
pa_channel_map_init_auto(&i.channel_map, 2, PA_CHANNEL_MAP_DEFAULT);
|
||||
i.formats = ip;
|
||||
d->cb(d->context, &i, 0, d->userdata);
|
||||
}
|
||||
|
|
@ -169,7 +170,7 @@ static void sink_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
static struct global *find_type_by_name(pa_context *c, uint32_t mask, const char *name)
|
||||
struct global *pa_context_find_global_by_name(pa_context *c, uint32_t mask, const char *name)
|
||||
{
|
||||
struct global *g;
|
||||
const char *str;
|
||||
|
|
@ -200,7 +201,7 @@ pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name,
|
|||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
||||
|
||||
if ((g = find_type_by_name(c, PA_SUBSCRIPTION_MASK_SINK, name)) == NULL)
|
||||
if ((g = pa_context_find_global_by_name(c, PA_SUBSCRIPTION_MASK_SINK, name)) == NULL)
|
||||
return NULL;
|
||||
|
||||
ensure_global(c, g);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue