diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c index 0df17e5aa..238fbd8ad 100644 --- a/src/pulsecore/cli-text.c +++ b/src/pulsecore/cli-text.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "cli-text.h" @@ -233,7 +234,7 @@ static const char *source_state_to_string(pa_source_state_t state) { char *pa_sink_list_to_string(pa_core *c) { pa_strbuf *s; - pa_sink *sink; + pa_sink *sink, *default_sink; uint32_t idx = PA_IDXSET_INVALID; pa_assert(c); @@ -241,6 +242,8 @@ char *pa_sink_list_to_string(pa_core *c) { pa_strbuf_printf(s, "%u sink(s) available.\n", pa_idxset_size(c->sinks)); + default_sink = pa_namereg_get_default_sink(c); + PA_IDXSET_FOREACH(sink, c->sinks, idx) { char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], @@ -275,7 +278,7 @@ char *pa_sink_list_to_string(pa_core *c) { "\tchannel map: %s%s%s\n" "\tused by: %u\n" "\tlinked by: %u\n", - sink == c->default_sink ? '*' : ' ', + sink == default_sink ? '*' : ' ', sink->index, sink->name, sink->driver, @@ -352,7 +355,7 @@ char *pa_sink_list_to_string(pa_core *c) { char *pa_source_list_to_string(pa_core *c) { pa_strbuf *s; - pa_source *source; + pa_source *source, *default_source; uint32_t idx = PA_IDXSET_INVALID; pa_assert(c); @@ -360,6 +363,8 @@ char *pa_source_list_to_string(pa_core *c) { pa_strbuf_printf(s, "%u source(s) available.\n", pa_idxset_size(c->sources)); + default_source = pa_namereg_get_default_source(c); + PA_IDXSET_FOREACH(source, c->sources, idx) { char ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], @@ -391,7 +396,7 @@ char *pa_source_list_to_string(pa_core *c) { "\tchannel map: %s%s%s\n" "\tused by: %u\n" "\tlinked by: %u\n", - c->default_source == source ? '*' : ' ', + source == default_source ? '*' : ' ', source->index, source->name, source->driver,