[MPlayer-cvslog] CVS: main/libao2 ao_jack.c,1.14,1.15

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Aug 18 11:41:01 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv32423/libao2

Modified Files:
	ao_jack.c 
Log Message:
name suboption for jack to set client name


Index: ao_jack.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_jack.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ao_jack.c	28 Jul 2005 17:11:22 -0000	1.14
+++ ao_jack.c	18 Aug 2005 09:40:59 -0000	1.15
@@ -207,6 +207,8 @@
            "\nOptions:\n"
            "  port=<port name>\n"
            "    Connects to the given ports instead of the default physical ones\n"
+           "  name=<client name>\n"
+           "    Client name to pass to JACK\n"
            "  estimate\n"
            "    Estimates the amount of data in buffers (experimental)\n");
 }
@@ -214,9 +216,10 @@
 static int init(int rate, int channels, int format, int flags) {
   const char **matching_ports = NULL;
   char *port_name = NULL;
-  char client_name[40];
+  char *client_name = NULL;
   opt_t subopts[] = {
     {"port", OPT_ARG_MSTRZ, &port_name, NULL},
+    {"name", OPT_ARG_MSTRZ, &client_name, NULL},
     {"estimate", OPT_ARG_BOOL, &estimate, NULL},
     {NULL}
   };
@@ -231,7 +234,10 @@
     mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] Invalid number of channels: %i\n", channels);
     goto err_out;
   }
+  if (!client_name) {
+    client_name = (char *)malloc(40);
   sprintf(client_name, "MPlayer [%d]", getpid());
+  }
   client = jack_client_new(client_name);
   if (!client) {
     mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n");
@@ -286,11 +292,13 @@
   ao_data.outburst = CHUNK_SIZE;
   free(matching_ports);
   free(port_name);
+  free(client_name);
   return 1;
 
 err_out:
   free(matching_ports);
   free(port_name);
+  free(client_name);
   if (client)
     jack_client_close(client);
   free(buffer);




More information about the MPlayer-cvslog mailing list