Browse Source

limit depth for port total latency computation

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@151 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 24 years ago
parent
commit
3fc014fd97
2 changed files with 13 additions and 5 deletions
  1. +1
    -1
      configure.in
  2. +12
    -4
      engine.c

+ 1
- 1
configure.in View File

@@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR(.)

JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=20
JACK_MICRO_VERSION=2
JACK_MICRO_VERSION=3

BETA=



+ 12
- 4
engine.c View File

@@ -1859,7 +1859,7 @@ jack_client_feeds (jack_client_internal_t *might, jack_client_internal_t *target
}

static nframes_t
jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port)
jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port, int hop_count)
{
GSList *node;
nframes_t latency;
@@ -1869,6 +1869,14 @@ jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port)
latency = port->shared->latency;

/* we don't prevent cyclic graphs, so we have to do something to bottom out
in the event that they are created.
*/

if (hop_count > 8) {
return latency;
}

for (node = port->connections; node; node = g_slist_next (node)) {

nframes_t this_latency;
@@ -1885,7 +1893,7 @@ jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port)
if (connection->source->shared->flags & JackPortIsTerminal) {
this_latency = connection->source->shared->latency;
} else {
this_latency = jack_get_port_total_latency (engine, connection->source);
this_latency = jack_get_port_total_latency (engine, connection->source, hop_count + 1);
}

} else {
@@ -1895,7 +1903,7 @@ jack_get_port_total_latency (jack_engine_t *engine, jack_port_internal_t *port)
if (connection->destination->shared->flags & JackPortIsTerminal) {
this_latency = connection->destination->shared->latency;
} else {
this_latency = jack_get_port_total_latency (engine, connection->destination);
this_latency = jack_get_port_total_latency (engine, connection->destination, hop_count + 1);
}
}

@@ -1915,7 +1923,7 @@ jack_compute_all_port_total_latencies (jack_engine_t *engine)

for (i = 0; i < engine->control->port_max; i++) {
if (shared[i].in_use) {
shared[i].total_latency = jack_get_port_total_latency (engine, &engine->internal_ports[i]);
shared[i].total_latency = jack_get_port_total_latency (engine, &engine->internal_ports[i], 0);
}
}
}


Loading…
Cancel
Save