impl-client: add workaround for old pipewire-media-session compatibility

pipewire-media-session purposefully makes one of its cores to lag the
other, and then uses it to bind ids it obtained from the faster core.
This no longer works with the registry generation number checks.

It's possible to fix in p-m-s, but we can also add a specific workaround
for it.

This workaround is supposed to be eventually removed.  Workarounds for
other apps should not be added.
This commit is contained in:
Pauli Virtanen 2022-02-23 00:44:01 +02:00
parent d71cf24183
commit 09d005aa3e
2 changed files with 13 additions and 0 deletions

View file

@ -228,6 +228,18 @@ static int finish_register(struct pw_impl_client *client)
pw_global_update_keys(client->global, client->info.props, keys); pw_global_update_keys(client->global, client->info.props, keys);
pw_global_register(client->global); pw_global_register(client->global);
#ifdef OLD_MEDIA_SESSION_WORKAROUND
/*
* XXX: temporary workaround for pipewire-media-session, see #2159
*/
if (spa_streq(spa_dict_lookup(client->info.props, PW_KEY_APP_NAME),
"pipewire-media-session")) {
client->recv_generation = UINT64_MAX;
pw_log_info("impl-client %p: enable old pipewire-media-session workaround",
client);
}
#endif
return 0; return 0;
} }

View file

@ -91,6 +91,7 @@ configure_file(input : 'version.h.in',
install_headers(pipewire_headers, subdir : pipewire_headers_dir) install_headers(pipewire_headers, subdir : pipewire_headers_dir)
libpipewire_c_args = [ libpipewire_c_args = [
'-DOLD_MEDIA_SESSION_WORKAROUND=1'
] ]
if build_machine.system() != 'freebsd' if build_machine.system() != 'freebsd'