[xiph-commits] r18119 - trunk/ao/src/plugins/esd

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sat Nov 19 12:05:08 PST 2011


Author: xiphmont
Date: 2011-11-19 12:05:08 -0800 (Sat, 19 Nov 2011)
New Revision: 18119

Modified:
   trunk/ao/src/plugins/esd/ao_esd.c
Log:
Add option "Client_name" to esd driver
patch provided by ph3-der-loewe
See Trac #1786


Modified: trunk/ao/src/plugins/esd/ao_esd.c
===================================================================
--- trunk/ao/src/plugins/esd/ao_esd.c	2011-11-19 20:02:52 UTC (rev 18118)
+++ trunk/ao/src/plugins/esd/ao_esd.c	2011-11-19 20:05:08 UTC (rev 18119)
@@ -40,7 +40,7 @@
 
 extern char **environ;
 
-static char *ao_esd_options[] = {"server","host","matrix","verbose","quiet","debug"};
+static char *ao_esd_options[] = {"server","host","matrix","verbose","quiet","debug","client_name"};
 static ao_info ao_esd_info =
 {
 	AO_TYPE_LIVE,
@@ -59,6 +59,7 @@
 {
 	int sock;
 	char *host;
+        char *client_name;
         char bugbuffer[4096];
         int bugfill;
         int bits;
@@ -134,6 +135,7 @@
 		return 0; /* Could not initialize device memory */
 
 	internal->host = NULL;
+	internal->client_name = NULL;
         internal->sock = -1;
 	device->internal = internal;
         device->output_matrix_order = AO_OUTPUT_MATRIX_FIXED;
@@ -149,6 +151,9 @@
 	if (!strcmp(key, "host") || !strcmp(key, "server")) {
 		if(internal->host) free(internal->host);
 		internal->host = strdup(value);
+	} else if (!strcmp(key, "client_name")) {
+		if(internal->client_name) free(internal->client_name);
+		internal->client_name = strdup(value);
 	}
 
 	return 1;
@@ -189,7 +194,8 @@
 
 	internal->sock = esd_play_stream(esd_format, format->rate,
 					 internal->host,
-					 "libao output");
+					 internal->client_name == NULL ?
+                                         "libao output" : internal->client_name);
 	if (internal->sock < 0)
 		return 0; /* Could not contact ESD server */
 
@@ -302,6 +308,7 @@
   ao_esd_internal *internal = (ao_esd_internal *) device->internal;
 
   if(internal->host) free(internal->host);
+  if(internal->client_name) free(internal->client_name);
   free(internal);
   device->internal=NULL;
 }



More information about the commits mailing list