# HG changeset patch # User reimar # Date 1124358059 0 # Node ID d7b41311866ab709fb58ff43b79be48427c32dd6 # Parent aa8f80ce03a451d4d31f34b21ff8bb18c3e3f9af name suboption for jack to set client name diff -r aa8f80ce03a4 -r d7b41311866a DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Wed Aug 17 23:39:19 2005 +0000 +++ b/DOCS/man/en/mplayer.1 Thu Aug 18 09:40:59 2005 +0000 @@ -1902,6 +1902,9 @@ .RSs .IPs port= Connects to the ports with the given name (default: physical ports). +.IPs name= +Client name that is passed to JACK (default: MPlayer []). +Useful if you want to have certain connections established automatically. .IPs (no)estimate Estimate the audio delay, supposed to make the video playback smoother (default: enabled). diff -r aa8f80ce03a4 -r d7b41311866a libao2/ao_jack.c --- a/libao2/ao_jack.c Wed Aug 17 23:39:19 2005 +0000 +++ b/libao2/ao_jack.c Thu Aug 18 09:40:59 2005 +0000 @@ -207,6 +207,8 @@ "\nOptions:\n" " port=\n" " Connects to the given ports instead of the default physical ones\n" + " 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);