mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 21:18:03 +02:00
si-softdsp-endpoint: use the adapter's stream if it's the only one
This commit is contained in:
parent
82abe41759
commit
874d39d99c
1 changed files with 6 additions and 2 deletions
|
|
@ -52,8 +52,9 @@ si_audio_softdsp_endpoint_get_properties (WpSiEndpoint * item)
|
|||
static guint
|
||||
si_audio_softdsp_endpoint_get_n_streams (WpSiEndpoint * item)
|
||||
{
|
||||
WpSiAudioSoftdspEndpoint *self = WP_SI_AUDIO_SOFTDSP_ENDPOINT (item);
|
||||
return self->num_streams;
|
||||
guint n_streams = wp_session_bin_get_n_children (WP_SESSION_BIN (item));
|
||||
/* n_streams includes the adapter; remove it, unless it's the only one */
|
||||
return (n_streams > 1) ? (n_streams - 1) : 1;
|
||||
}
|
||||
|
||||
static WpSiStream *
|
||||
|
|
@ -63,6 +64,9 @@ si_audio_softdsp_endpoint_get_stream (WpSiEndpoint * item, guint index)
|
|||
g_autoptr (WpIterator) it = wp_session_bin_iterate (WP_SESSION_BIN (self));
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
|
||||
if (wp_session_bin_get_n_children (WP_SESSION_BIN (item)) == 1)
|
||||
return WP_SI_STREAM (self->adapter);
|
||||
|
||||
/* TODO: do not asume the items are always sorted */
|
||||
guint i = 0;
|
||||
for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue