diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-03 10:42:23 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-03 10:42:23 +0000 |
commit | 2de070ff95df708a9d84a9fcc97e0a2b130536e3 (patch) | |
tree | 0b4b5026b53eda1e4fb35e4259332d92f773c46e /libao2/ao_pulse.c | |
parent | f4f7560a1ed8d6315eb33ee2fc1be0cc3eac6dcb (diff) | |
download | mpv-2de070ff95df708a9d84a9fcc97e0a2b130536e3.tar.bz2 mpv-2de070ff95df708a9d84a9fcc97e0a2b130536e3.tar.xz |
Change parsing to allow host == NULL and sink != NULL
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24949 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_pulse.c')
-rw-r--r-- | libao2/ao_pulse.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c index 4e9030c802..ad4a7447bc 100644 --- a/libao2/ao_pulse.c +++ b/libao2/ao_pulse.c @@ -122,13 +122,15 @@ static int init(int rate_hz, int channels, int format, int flags) { struct pa_sample_spec ss; struct pa_channel_map map; const struct format_map_s *fmt_map; + char *devarg = NULL; char *host = NULL; char *sink = NULL; if (ao_subdevice) { - host = strdup(ao_subdevice); - sink = strchr(host, ':'); + devarg = strdup(ao_subdevice); + sink = strchr(devarg, ':'); if (sink) *sink++ = 0; + if (devarg[0]) host = devarg; } ss.channels = channels; @@ -202,7 +204,7 @@ static int init(int rate_hz, int channels, int format, int flags) { pa_threaded_mainloop_unlock(mainloop); - free(host); + free(devarg); return 1; unlock_and_fail: @@ -213,7 +215,7 @@ unlock_and_fail: fail: if (context) GENERIC_ERR_MSG(context, "Init failed"); - free(host); + free(devarg); uninit(1); return 0; } |