mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Revert "pulse: we can pass the device name directly in NODE_TARGET now"
This reverts commit fc6a729c57.
Pulse passes either the monitor id or the sink.monitor name, which
are not known to the session manager.
This commit is contained in:
parent
fc6a729c57
commit
ec860d64cf
1 changed files with 20 additions and 2 deletions
|
|
@ -848,6 +848,7 @@ static int create_stream(pa_stream_direction_t direction,
|
|||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
const char *str;
|
||||
uint32_t devid, n_items;
|
||||
struct global *g;
|
||||
struct spa_dict_item items[7];
|
||||
bool monitor, no_remix;
|
||||
const char *name;
|
||||
|
|
@ -955,8 +956,25 @@ static int create_stream(pa_stream_direction_t direction,
|
|||
else
|
||||
devid = PW_ID_ANY;
|
||||
|
||||
if (dev == NULL)
|
||||
dev = getenv("PIPEWIRE_NODE");
|
||||
if (dev == NULL) {
|
||||
if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
||||
devid = atoi(str);
|
||||
}
|
||||
else if (devid == PW_ID_ANY) {
|
||||
uint32_t mask;
|
||||
|
||||
if (direction == PA_STREAM_PLAYBACK)
|
||||
mask = PA_SUBSCRIPTION_MASK_SINK;
|
||||
else if (direction == PA_STREAM_RECORD)
|
||||
mask = PA_SUBSCRIPTION_MASK_SOURCE;
|
||||
else
|
||||
mask = 0;
|
||||
|
||||
if ((g = pa_context_find_global_by_name(s->context, mask, dev)) != NULL)
|
||||
devid = g->id;
|
||||
else if ((devid = atoi(dev)) == 0)
|
||||
devid = PW_ID_ANY;
|
||||
}
|
||||
|
||||
if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) {
|
||||
if (strcmp(str, "video") == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue