From fff065e08975be8712697b8e4ff8887a4f503901 Mon Sep 17 00:00:00 2001 From: pbd Date: Thu, 12 Dec 2002 13:54:54 +0000 Subject: [PATCH] latency fix, plus latency output from jack_lsp git-svn-id: svn+ssh://jackaudio.org/trunk/jack@279 0c269be4-1314-0410-8aa9-9f06e86f4224 --- configure.in | 6 +++--- example-clients/lsp.c | 11 +++++++++++ jackd/engine.c | 9 ++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 151c4dd..f99553a 100644 --- a/configure.in +++ b/configure.in @@ -14,7 +14,7 @@ dnl changes are made dnl --- JACK_MAJOR_VERSION=0 JACK_MINOR_VERSION=41 -JACK_MICRO_VERSION=0 +JACK_MICRO_VERSION=1 dnl --- dnl HOWTO: updating the libjack interface version @@ -31,8 +31,8 @@ dnl slacker than this, and closer to those for the JACK version dnl number. dnl --- JACK_API_CURRENT=0 -JACK_API_REVISION=6 -JACK_API_AGE=0 +JACK_API_REVISION=7 +JACK_API_AGE=1 AC_SUBST(JACK_MAJOR_VERSION) AC_SUBST(JACK_MINOR_VERSION) diff --git a/example-clients/lsp.c b/example-clients/lsp.c index 4249098..51465d1 100644 --- a/example-clients/lsp.c +++ b/example-clients/lsp.c @@ -12,11 +12,15 @@ main (int argc, char *argv[]) const char **ports, **connections; unsigned int i, j; int show_con = 0; + int show_latency = 0; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-c")) { show_con = 1; } + if (!strcmp(argv[i], "-l")) { + show_latency = 1; + } } /* try to become a client of the JACK server */ @@ -38,6 +42,13 @@ main (int argc, char *argv[]) free (connections); } } + if (show_latency) { + jack_port_t *port = jack_port_by_name (client, ports[i]); + if (port) { + printf (" latency = %lu frames\n", jack_port_get_total_latency (client, port)); + free (port); + } + } } jack_client_close (client); diff --git a/jackd/engine.c b/jackd/engine.c index 4c373b5..9c08c9f 100644 --- a/jackd/engine.c +++ b/jackd/engine.c @@ -2401,8 +2401,7 @@ jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port, if ((toward_port && (connection->source->shared == port->shared)) || - /* !toward_port is implicit */ - (connection->destination->shared == port->shared)) { + (!toward_port && (connection->destination->shared == port->shared))) { continue; } @@ -2448,10 +2447,10 @@ jack_compute_all_port_total_latencies (jack_engine_t *engine) for (i = 0; i < engine->control->port_max; i++) { if (shared[i].in_use) { - if (shared->flags & JackPortIsOutput) { - toward_port = TRUE; - } else { + if (shared[i].flags & JackPortIsOutput) { toward_port = FALSE; + } else { + toward_port = TRUE; } shared[i].total_latency = jack_get_port_total_latency (engine, &engine->internal_ports[i], 0, toward_port); }