PA_IDXSET_FOREACH(sink, u->core->sinks, idx) {
if (sink->module == m) {
- pa_assert(sink->input_to_master != NULL);
+ pa_assert(pa_sink_is_filter(sink));
fltr = filter_new(name, sink->input_to_master->sink, NULL);
fltr->module_index = m->index;
PA_IDXSET_FOREACH(source, u->core->sources, idx) {
if (source->module == m && !source->monitor_of) {
- pa_assert(source->output_from_master != NULL);
+ pa_assert(pa_source_is_filter(source));
if (!fltr) {
fltr = filter_new(name, NULL, source->output_from_master->source);
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);
}
/* 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;
/* Get the master sink when sharing volumes */
pa_sink *pa_sink_get_master(pa_sink *s);
+bool pa_sink_is_filter(pa_sink *s);
+
/* Is the sink in passthrough mode? (that is, is there a passthrough sink input
* connected to this sink? */
bool pa_sink_is_passthrough(pa_sink *s);
pa_assert_ctl_context();
pa_assert(s->state == PA_SOURCE_INIT);
- pa_assert(!(s->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER) || s->output_from_master);
+ pa_assert(!(s->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER) || pa_source_is_filter(s));
/* The following fields must be initialized properly when calling _put() */
pa_assert(s->asyncmsgq);
}
/* Called from main context */
+bool pa_source_is_filter(pa_source *s) {
+ pa_source_assert_ref(s);
+
+ return (s->output_from_master != NULL);
+}
+
+/* Called from main context */
bool pa_source_is_passthrough(pa_source *s) {
pa_source_assert_ref(s);
/* Get the master source when sharing volumes */
pa_source *pa_source_get_master(pa_source *s);
+bool pa_source_is_filter(pa_source *s);
+
/* Is the source in passthrough mode? (that is, is this a monitor source for a sink
* that has a passthrough sink input connected to it. */
bool pa_source_is_passthrough(pa_source *s);