From a5401a50a67ebf1d86e979ee5556961b24a25400 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 28 Jan 2009 01:46:27 +0100 Subject: store the default sink/source in proper pa_sink*/pa_source* pointers instead of a string --- src/pulsecore/protocol-http.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/protocol-http.c') diff --git a/src/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c index c89d48b6..5379a36c 100644 --- a/src/pulsecore/protocol-http.c +++ b/src/pulsecore/protocol-http.c @@ -156,6 +156,8 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) { if (!strcmp(c->url, URL_ROOT)) { char txt[256]; + pa_sink *def_sink; + pa_source *def_source; http_response(c, 200, "OK", "text/html"); pa_ioline_puts(c->line, @@ -173,8 +175,12 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) { PRINTF_FIELD("User Name:", pa_get_user_name(txt, sizeof(txt))); PRINTF_FIELD("Host name:", pa_get_host_name(txt, sizeof(txt))); PRINTF_FIELD("Default Sample Specification:", pa_sample_spec_snprint(txt, sizeof(txt), &c->protocol->core->default_sample_spec)); - PRINTF_FIELD("Default Sink:", pa_namereg_get_default_sink_name(c->protocol->core)); - PRINTF_FIELD("Default Source:", pa_namereg_get_default_source_name(c->protocol->core)); + + def_sink = pa_namereg_get_default_sink(c->protocol->core); + def_source = pa_namereg_get_default_source(c->protocol->core); + + PRINTF_FIELD("Default Sink:", def_sink ? def_sink->name : "n/a"); + PRINTF_FIELD("Default Source:", def_source ? def_source->name : "n/a"); pa_ioline_puts(c->line, ""); -- cgit