module: use resample.prefill for coupled streams

So that we always process one complete input buffer as an output
buffer without keeping leftovers in the resampler.
This commit is contained in:
Wim Taymans 2022-09-19 12:51:14 +02:00
parent 31f9e18edb
commit 94336cb2c9
2 changed files with 6 additions and 0 deletions

View file

@ -2200,6 +2200,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "filter-chain-%u-%u", pid, id); pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "filter-chain-%u-%u", pid, id);
if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL) if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL)
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true"); pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
if (pw_properties_get(props, "resample.prefill") == NULL)
pw_properties_set(props, "resample.prefill", "true");
if (pw_properties_get(props, PW_KEY_NODE_DESCRIPTION) == NULL) if (pw_properties_get(props, PW_KEY_NODE_DESCRIPTION) == NULL)
pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION, "filter-chain-%u-%u", pid, id); pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION, "filter-chain-%u-%u", pid, id);
@ -2217,6 +2219,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
copy_props(impl, props, PW_KEY_NODE_LATENCY); copy_props(impl, props, PW_KEY_NODE_LATENCY);
copy_props(impl, props, PW_KEY_NODE_VIRTUAL); copy_props(impl, props, PW_KEY_NODE_VIRTUAL);
copy_props(impl, props, PW_KEY_MEDIA_NAME); copy_props(impl, props, PW_KEY_MEDIA_NAME);
copy_props(impl, props, "resample.prefill");
parse_audio_info(impl->capture_props, &impl->capture_info); parse_audio_info(impl->capture_props, &impl->capture_info);
parse_audio_info(impl->playback_props, &impl->playback_info); parse_audio_info(impl->playback_props, &impl->playback_info);

View file

@ -523,6 +523,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "loopback-%u-%u", pid, id); pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "loopback-%u-%u", pid, id);
if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL) if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL)
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true"); pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
if (pw_properties_get(props, "resample.prefill") == NULL)
pw_properties_set(props, "resample.prefill", "true");
if ((str = pw_properties_get(props, "capture.props")) != NULL) if ((str = pw_properties_get(props, "capture.props")) != NULL)
pw_properties_update_string(impl->capture_props, str, strlen(str)); pw_properties_update_string(impl->capture_props, str, strlen(str));
@ -538,6 +540,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
copy_props(impl, props, PW_KEY_NODE_LATENCY); copy_props(impl, props, PW_KEY_NODE_LATENCY);
copy_props(impl, props, PW_KEY_NODE_VIRTUAL); copy_props(impl, props, PW_KEY_NODE_VIRTUAL);
copy_props(impl, props, PW_KEY_MEDIA_NAME); copy_props(impl, props, PW_KEY_MEDIA_NAME);
copy_props(impl, props, "resample.prefill");
if ((str = pw_properties_get(props, PW_KEY_NODE_NAME)) == NULL) { if ((str = pw_properties_get(props, PW_KEY_NODE_NAME)) == NULL) {
pw_properties_setf(props, PW_KEY_NODE_NAME, pw_properties_setf(props, PW_KEY_NODE_NAME,