mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
cli: Output asterisk when default sink/source is found
These days we don't set core->default_sink/source as soon as somebody asks for it. To retain consistent behaviour (i e the asterisk), we need to call pa_namereg_get_default_sink/source. Reported-by: Daniel Manrique <daniel.manrique@canonical.com> Reported-by: Brendan Donegan <brendan.donegan@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
fcaef8285a
commit
9e1627e2a3
1 changed files with 9 additions and 4 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include <pulsecore/core-scache.h>
|
||||
#include <pulsecore/macro.h>
|
||||
#include <pulsecore/core-util.h>
|
||||
#include <pulsecore/namereg.h>
|
||||
|
||||
#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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue