diff options
author | ben <benjaminfranzke@googlemail.com> | 2010-07-13 18:14:53 +0200 |
---|---|---|
committer | ben <benjaminfranzke@googlemail.com> | 2010-07-13 18:14:53 +0200 |
commit | 3138211b2b00e1b4bdcc2d29486473969285da1e (patch) | |
tree | acc05dade652031d6f07885b59b419b97eb1558b /src/pa-sink-ctl.c | |
parent | 49c29950a85818f4b516a9c4c4f80c05214238a2 (diff) | |
download | pa-sink-ctl-3138211b2b00e1b4bdcc2d29486473969285da1e.tar.gz pa-sink-ctl-3138211b2b00e1b4bdcc2d29486473969285da1e.tar.bz2 pa-sink-ctl-3138211b2b00e1b4bdcc2d29486473969285da1e.zip |
display name instead of device when device prop is not available
Diffstat (limited to 'src/pa-sink-ctl.c')
-rw-r--r-- | src/pa-sink-ctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |