[MPlayer-cvslog] r24949 - trunk/libao2/ao_pulse.c

reimar subversion at mplayerhq.hu
Sat Nov 3 11:42:23 CET 2007


Author: reimar
Date: Sat Nov  3 11:42:23 2007
New Revision: 24949

Log:
Change parsing to allow host == NULL and sink != NULL


Modified:
   trunk/libao2/ao_pulse.c

Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c	(original)
+++ trunk/libao2/ao_pulse.c	Sat Nov  3 11:42:23 2007
@@ -122,13 +122,15 @@ static int init(int rate_hz, int channel
     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 channel
 
     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;
 }



More information about the MPlayer-cvslog mailing list