Skip to content
Snippets Groups Projects
Commit 874d39d9 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

si-softdsp-endpoint: use the adapter's stream if it's the only one

parent 82abe417
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment