summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2013-06-03 17:38:04 +0000
committerwm4 <wm4@nowhere>2013-06-04 01:31:20 +0200
commit774dc23ab34cc4c38f3d1d04c7d5dc6190ec923b (patch)
tree8acb2769b372325fb843a2f53d81635ec51723a1 /audio/out
parent3725ab980c8d37fca46cbeced0b0102441c3eeef (diff)
downloadmpv-774dc23ab34cc4c38f3d1d04c7d5dc6190ec923b.tar.bz2
mpv-774dc23ab34cc4c38f3d1d04c7d5dc6190ec923b.tar.xz
ao_jack: add (no-)connect suboption
Add (no)connect option to ao_jack. Patch by Markus Appel [masolomaster3000 googlemail com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36297 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 audio/out/ao_jack.c
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_jack.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c
index c93d07c2a2..abcd73849c 100644
--- a/audio/out/ao_jack.c
+++ b/audio/out/ao_jack.c
@@ -191,6 +191,8 @@ static void print_help (void)
"Example: mpv -ao jack:port=myout\n"
" connects mpv 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 @@ static int init(int rate, const struct mp_chmap *channels, int format, int flags
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;
@@ -243,18 +247,20 @@ static int init(int rate, const struct mp_chmap *channels, int format, int flags
buffer = av_fifo_alloc(BUFFSIZE);
jack_set_process_callback(client, outputaudio, 0);
- // list matching ports
- if (!port_name)
- port_flags |= JackPortIsPhysical;
- matching_ports = jack_get_ports(client, port_name, NULL, port_flags);
- if (!matching_ports || !matching_ports[0]) {
- mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n");
- goto err_out;
+ // 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);
+ if (!matching_ports || !matching_ports[0]) {
+ mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n");
+ goto err_out;
+ }
+ i = 1;
+ num_ports = ao_data.channels.num;
+ while (matching_ports[i]) i++;
+ if (num_ports > i) num_ports = i;
}
- i = 1;
- num_ports = ao_data.channels.num;
- while (matching_ports[i]) i++;
- if (num_ports > i) num_ports = i;
// create out output ports
for (i = 0; i < num_ports; i++) {