diff options
author | Arun Raghavan <git@arunraghavan.net> | 2015-06-09 12:06:48 +0530 |
---|---|---|
committer | Arun Raghavan <git@arunraghavan.net> | 2015-06-12 12:43:18 +0530 |
commit | 81f7589a3fcba771e94d2aec67fb9e04a44e7086 (patch) | |
tree | 61c291491a224a5d22e379c9652845bf86f448b9 /src/pulsecore/sink.c | |
parent | 5adb126259958ab106584034f6a3c94a8ec4af60 (diff) |
sink,source: Add a helper function to check whether this is a filter
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r-- | src/pulsecore/sink.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index a22c19939..c2bf0e448 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -580,7 +580,7 @@ void pa_sink_put(pa_sink* s) { pa_assert_ctl_context(); pa_assert(s->state == PA_SINK_INIT); - pa_assert(!(s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER) || s->input_to_master); + pa_assert(!(s->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER) || pa_sink_is_filter(s)); /* The following fields must be initialized properly when calling _put() */ pa_assert(s->asyncmsgq); @@ -1558,6 +1558,13 @@ pa_sink *pa_sink_get_master(pa_sink *s) { } /* Called from main context */ +bool pa_sink_is_filter(pa_sink *s) { + pa_sink_assert_ref(s); + + return (s->input_to_master != NULL); +} + +/* Called from main context */ bool pa_sink_is_passthrough(pa_sink *s) { pa_sink_input *alt_i; uint32_t idx; |