summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_pulse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c
index 6f62d1df6c..4e9030c802 100644
--- a/libao2/ao_pulse.c
+++ b/libao2/ao_pulse.c
@@ -126,11 +126,9 @@ static int init(int rate_hz, int channels, int format, int flags) {
char *sink = NULL;
if (ao_subdevice) {
- int i = strcspn(ao_subdevice, ":");
host = strdup(ao_subdevice);
- if (host[i] == ':')
- sink = &host[i + 1];
- host[i] = 0;
+ sink = strchr(host, ':');
+ if (sink) *sink++ = 0;
}
ss.channels = channels;