From 3138211b2b00e1b4bdcc2d29486473969285da1e Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 13 Jul 2010 18:14:53 +0200 Subject: display name instead of device when device prop is not available --- src/pa-sink-ctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pa-sink-ctl.c') diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index e70c144..dac91c0 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -114,7 +114,8 @@ void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_last, v sink_list[sink_counter]->vol = pa_cvolume_avg(&i->volume); sink_list[sink_counter]->channels = i->volume.channels; sink_list[sink_counter]->name = strdup(i->name); - sink_list[sink_counter]->device = strdup(pa_proplist_gets(i->proplist, "device.product.name")); + const char *tmp = pa_proplist_gets(i->proplist, "device.product.name"); + sink_list[sink_counter]->device = (tmp == NULL) ? NULL : strdup(tmp); ++sink_counter; } -- cgit