si-adapter: use the clock rate defined in pipewire.conf

This commit is contained in:
George Kiagiadakis 2020-06-15 19:09:04 +03:00
parent 7bc8302740
commit 5f9212c344

View file

@ -313,7 +313,15 @@ si_adapter_activate_execute_step (WpSessionItem * item,
/* now choose the DSP format: keep the chanels but use F32 plannar @ 48K */
self->format.format = SPA_AUDIO_FORMAT_F32P;
self->format.rate = 48000;
self->format.rate = ({
g_autoptr (WpCore) core = wp_proxy_get_core (WP_PROXY (self->node));
g_autoptr (WpProperties) props = wp_core_get_remote_properties (core);
const gchar *rate_str = wp_properties_get (props, "default.clock.rate");
rate_str ? atoi (rate_str) : 48000;
});
wp_debug_object (item, "format: F32P %uch @ %u",
self->format.channels, self->format.rate);
port_format = format_audio_raw_build (&self->format);
pod = wp_spa_pod_new_object ("PortConfig", "PortConfig",