summaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 88425d2..9476c69 100644
--- a/utils.c
+++ b/utils.c
@@ -196,13 +196,31 @@ pa_sink *agl_utils_get_primary_alsa_sink (struct userdata *u)
pa_assert_se ((core = u->core));
PA_IDXSET_FOREACH(sink, core->sinks, idx) {
- if (sink->name && strstr (sink->name, "alsa_output"))
+ if (sink->name && strstr (sink->name, "alsa_output") && strstr (sink->name, "pci"))
return sink;
}
return NULL;
}
+pa_sink *agl_utils_get_alsa_sink (struct userdata *u, const char *name)
+{
+ pa_core *core;
+ pa_sink *sink;
+ int idx;
+
+ pa_assert (u);
+ pa_assert_se ((core = u->core));
+
+ PA_IDXSET_FOREACH(sink, core->sinks, idx) {
+ if (sink->name && strstr (sink->name, "alsa_output")
+ && strstr (sink->name, name))
+ return sink;
+ }
+
+ return NULL;
+}
+
void agl_utils_init_stamp (void)
{
stamp = 0;