pulse: we can pass the device name directly in NODE_TARGET now

This commit is contained in:
Wim Taymans 2020-10-24 16:09:28 +02:00
parent 3567efb7f8
commit fc6a729c57

View file

@ -848,7 +848,6 @@ 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));
const char *str; const char *str;
uint32_t devid, n_items; uint32_t devid, n_items;
struct global *g;
struct spa_dict_item items[7]; struct spa_dict_item items[7];
bool monitor, no_remix; bool monitor, no_remix;
const char *name; const char *name;
@ -956,25 +955,8 @@ static int create_stream(pa_stream_direction_t direction,
else else
devid = PW_ID_ANY; devid = PW_ID_ANY;
if (dev == NULL) { if (dev == NULL)
if ((str = getenv("PIPEWIRE_NODE")) != NULL) dev = getenv("PIPEWIRE_NODE");
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 ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) {
if (strcmp(str, "video") == 0) if (strcmp(str, "video") == 0)