changeset 36201:fe3993b42091

Add (no)connect option to ao_jack. Patch by Markus Appel [masolomaster3000 googlemail com].
author reimar
date Mon, 03 Jun 2013 17:38:04 +0000
parents a86d2ecfc4ee
children 53cb51bbc317
files DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 libao2/ao_jack.c
diffstat 3 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/de/mplayer.1	Mon Jun 03 11:20:28 2013 +0000
+++ b/DOCS/man/de/mplayer.1	Mon Jun 03 17:38:04 2013 +0000
@@ -3027,6 +3027,11 @@
 Audioausgabe über JACK (Jack Audio Connection Kit)
 .PD 0
 .RSs
+.IPs (no)connect
+Erzeugt automatisch Verbindungen zu den Ausgabeports
+(Standard: eingeschaltet).
+Falls eingeschaltet wird die Anzahl der Audiokanäle durch die Anzahl der
+gefundenen Ausgabeports nach oben begrenzt.
 .IPs port=<Name>
 Verbindet zu den Ports mit dem angegebenen Namen (Standard: physikalische
 Ports).
--- a/DOCS/man/en/mplayer.1	Mon Jun 03 11:20:28 2013 +0000
+++ b/DOCS/man/en/mplayer.1	Mon Jun 03 17:38:04 2013 +0000
@@ -3118,6 +3118,10 @@
 audio output through JACK (Jack Audio Connection Kit)
 .PD 0
 .RSs
+.IPs (no)connect
+Automatically create connections to output ports (default: enabled).
+When enabled, the maximum number of output channels will be limited to
+the number of available output ports.
 .IPs port=<name>
 Connects to the ports with the given name (default: physical ports).
 .IPs name=<client name>
--- a/libao2/ao_jack.c	Mon Jun 03 11:20:28 2013 +0000
+++ b/libao2/ao_jack.c	Mon Jun 03 17:38:04 2013 +0000
@@ -192,6 +192,8 @@
            "Example: mplayer -ao jack:port=myout\n"
            "  connects MPlayer to the jack ports named myout\n"
            "\nOptions:\n"
+           "  connect\n"
+           "    Automatically connect to output ports\n"
            "  port=<port name>\n"
            "    Connects to the given ports instead of the default physical ones\n"
            "  name=<client name>\n"
@@ -208,11 +210,13 @@
   char *port_name = NULL;
   char *client_name = NULL;
   int autostart = 0;
+  int connect = 1;
   const opt_t subopts[] = {
     {"port", OPT_ARG_MSTRZ, &port_name, NULL},
     {"name", OPT_ARG_MSTRZ, &client_name, NULL},
     {"estimate", OPT_ARG_BOOL, &estimate, NULL},
     {"autostart", OPT_ARG_BOOL, &autostart, NULL},
+    {"connect", OPT_ARG_BOOL, &connect, NULL},
     {NULL}
   };
   jack_options_t open_options = JackUseExactName;
@@ -241,7 +245,8 @@
   buffer = av_fifo_alloc(BUFFSIZE);
   jack_set_process_callback(client, outputaudio, 0);
 
-  // list matching ports
+  // list matching ports if connections should be made
+  if (connect) {
   if (!port_name)
     port_flags |= JackPortIsPhysical;
   matching_ports = jack_get_ports(client, port_name, NULL, port_flags);
@@ -252,6 +257,7 @@
     goto err_out;
   }
   if (channels > i) channels = i;
+  }
   num_ports = channels;
 
   // create out_* output ports