mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
stream: fix for target_id
This commit is contained in:
parent
ed2f054e76
commit
a70b02064c
1 changed files with 8 additions and 6 deletions
14
src/stream.c
14
src/stream.c
|
|
@ -780,7 +780,7 @@ static int create_stream(pa_stream_direction_t direction,
|
||||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||||
uint32_t sample_rate = 0, stride = 0;
|
uint32_t sample_rate = 0, stride = 0;
|
||||||
const char *str;
|
const char *str;
|
||||||
char devid[16];
|
uint32_t devid;
|
||||||
struct global *g;
|
struct global *g;
|
||||||
struct spa_dict_item items[5];
|
struct spa_dict_item items[5];
|
||||||
char latency[64];
|
char latency[64];
|
||||||
|
|
@ -845,11 +845,13 @@ static int create_stream(pa_stream_direction_t direction,
|
||||||
s->buffer_attr = *attr;
|
s->buffer_attr = *attr;
|
||||||
patch_buffer_attr(s, &s->buffer_attr, &flags);
|
patch_buffer_attr(s, &s->buffer_attr, &flags);
|
||||||
|
|
||||||
if (dev == NULL)
|
devid = SPA_ID_INVALID;
|
||||||
dev = getenv("PIPEWIRE_NODE");
|
if (dev == NULL) {
|
||||||
|
if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
||||||
|
devid = atoi(str);
|
||||||
|
}
|
||||||
else if ((g = pa_context_find_global_by_name(s->context, PA_SUBSCRIPTION_MASK_SINK, dev)) != NULL) {
|
else if ((g = pa_context_find_global_by_name(s->context, PA_SUBSCRIPTION_MASK_SINK, dev)) != NULL) {
|
||||||
snprintf(devid, 15, "%d", g->id);
|
devid = g->id;
|
||||||
dev = devid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) == NULL)
|
if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) == NULL)
|
||||||
|
|
@ -889,7 +891,7 @@ static int create_stream(pa_stream_direction_t direction,
|
||||||
direction == PA_STREAM_PLAYBACK ?
|
direction == PA_STREAM_PLAYBACK ?
|
||||||
PW_DIRECTION_OUTPUT :
|
PW_DIRECTION_OUTPUT :
|
||||||
PW_DIRECTION_INPUT,
|
PW_DIRECTION_INPUT,
|
||||||
dev,
|
devid,
|
||||||
fl,
|
fl,
|
||||||
params, n_params);
|
params, n_params);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue