diff --git a/modules/module-si-audio-adapter.c b/modules/module-si-audio-adapter.c index c3a3c965..4d47be66 100644 --- a/modules/module-si-audio-adapter.c +++ b/modules/module-si-audio-adapter.c @@ -27,7 +27,6 @@ struct _WpSiAudioAdapter WpNode *node; gchar name[96]; gchar media_class[32]; - guint preferred_n_channels; gboolean control_port; gboolean monitor; WpDirection direction; @@ -64,7 +63,6 @@ si_audio_adapter_reset (WpSessionItem * item) self->control_port = FALSE; self->monitor = FALSE; self->direction = WP_DIRECTION_INPUT; - self->preferred_n_channels = 0; WP_SESSION_ITEM_CLASS (si_audio_adapter_parent_class)->reset (item); } @@ -116,13 +114,6 @@ si_audio_adapter_configure (WpSessionItem * item, WpProperties *p) self->direction = WP_DIRECTION_OUTPUT; wp_properties_setf (si_props, "direction", "%u", self->direction); - str = wp_properties_get (si_props, "preferred.n.channels"); - if (str && sscanf(str, "%u", &self->preferred_n_channels) != 1) - return FALSE; - if (!str) - wp_properties_setf (si_props, "preferred.n.channels", "%u", - self->preferred_n_channels); - str = wp_properties_get (si_props, "enable.control.port"); if (str && sscanf(str, "%u", &self->control_port) != 1) return FALSE; @@ -299,7 +290,6 @@ on_node_enum_format_done (WpPipewireObject * proxy, GAsyncResult * res, WpSiAudioAdapter *self = wp_transition_get_source_object (transition); g_autoptr (WpIterator) formats = NULL; g_autoptr (GError) error = NULL; - gint pref_chan; formats = wp_pipewire_object_enum_params_finish (proxy, res, &error); if (error) { @@ -309,9 +299,7 @@ on_node_enum_format_done (WpPipewireObject * proxy, GAsyncResult * res, /* 34 is the max number of channels that SPA knows about in the spa_audio_channel enum */ - pref_chan = self->preferred_n_channels ? self->preferred_n_channels : 34; - - if (!choose_sensible_raw_audio_format (formats, pref_chan, &self->format)) { + if (!choose_sensible_raw_audio_format (formats, 34, &self->format)) { wp_warning_object (self, "failed to choose a sensible audio format"); wp_transition_return_error (transition, g_error_new (WP_DOMAIN_LIBRARY, WP_LIBRARY_ERROR_OPERATION_FAILED, diff --git a/tests/examples/audiotestsrc-play.c b/tests/examples/audiotestsrc-play.c index 3e9dee8a..0a72c7dd 100644 --- a/tests/examples/audiotestsrc-play.c +++ b/tests/examples/audiotestsrc-play.c @@ -175,7 +175,6 @@ on_node_added (WpObjectManager * om, WpNode *node, AppData * d) /* and configure it */ wp_properties_setf (props, "node", "%p", node); wp_properties_setf (props, "session", "%p", d->session); - wp_properties_setf (props, "preferred-n-channels", "%u", 2); if (!wp_session_item_configure (item, g_steal_pointer (&props))) { g_printerr ("Failed to configure session item\n"); g_main_loop_quit (d->loop); diff --git a/tests/modules/si-audio-adapter.c b/tests/modules/si-audio-adapter.c index e886f2ec..ef229d7d 100644 --- a/tests/modules/si-audio-adapter.c +++ b/tests/modules/si-audio-adapter.c @@ -91,9 +91,6 @@ test_si_audio_adapter_configure_activate (TestFixture * f, str = wp_properties_get (props, "direction"); g_assert_nonnull (str); g_assert_cmpstr ("1", ==, str); - str = wp_properties_get (props, "preferred.n.channels"); - g_assert_nonnull (str); - g_assert_cmpstr ("0", ==, str); str = wp_properties_get (props, "enable.control.port"); g_assert_nonnull (str); g_assert_cmpstr ("0", ==, str);