# HG changeset patch # User reimar # Date 1200084152 0 # Node ID 5cf7cb85128f16653f22f6ed9234659f1e80234c # Parent 2438052a176eae60c10d6fd338b98bc8315c3e4e Slightly deobfuscate diff -r 2438052a176e -r 5cf7cb85128f libao2/ao_jack.c --- a/libao2/ao_jack.c Fri Jan 11 20:36:33 2008 +0000 +++ b/libao2/ao_jack.c Fri Jan 11 20:42:32 2008 +0000 @@ -254,11 +254,12 @@ if (!port_name) port_flags |= JackPortIsPhysical; matching_ports = jack_get_ports(client, port_name, NULL, port_flags); - for (num_ports = 0; matching_ports && matching_ports[num_ports]; num_ports++) ; - if (!num_ports) { + if (!matching_ports || !matching_ports[0]) { mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n"); goto err_out; } + num_ports = 1; + while (matching_ports[num_ports]) num_ports++; if (channels > num_ports) channels = num_ports; num_ports = channels;