mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
role-cork: Don't ignore streams without media.role
When corking do not ignore streams without media.role. Instead treat them as if media.role="no_role", so that you can specify "no_role" as trigger or cork role.
This commit is contained in:
parent
092eb57974
commit
61164d3b51
1 changed files with 2 additions and 6 deletions
|
|
@ -77,7 +77,7 @@ static bool shall_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore) {
|
|||
continue;
|
||||
|
||||
if (!(role = pa_proplist_gets(j->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
continue;
|
||||
role = "no_role";
|
||||
|
||||
PA_IDXSET_FOREACH(trigger_role, u->trigger_roles, role_idx) {
|
||||
if (pa_streq(role, trigger_role)) {
|
||||
|
|
@ -107,7 +107,7 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
|
|||
continue;
|
||||
|
||||
if (!(role = pa_proplist_gets(j->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
continue;
|
||||
role = "no_role";
|
||||
|
||||
PA_IDXSET_FOREACH(cork_role, u->cork_roles, role_idx) {
|
||||
if ((trigger = pa_streq(role, cork_role)))
|
||||
|
|
@ -152,7 +152,6 @@ static void apply_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore, bo
|
|||
|
||||
static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, bool create) {
|
||||
bool cork = false;
|
||||
const char *role;
|
||||
|
||||
pa_assert(u);
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
|
@ -160,9 +159,6 @@ static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, bool creat
|
|||
if (!create)
|
||||
pa_hashmap_remove(u->cork_state, i);
|
||||
|
||||
if (!(role = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if (!i->sink)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue