diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2008-11-23 17:50:08 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2008-11-23 17:50:08 +0000 |
commit | 25d2d8f48a1c0f9dcbeabfff01946389e3c469a8 (patch) | |
tree | 1b811daca29de248a75ed60548f9fee0bffb2ca0 /ext/jack | |
parent | 63969842df3c7467b7572b608ed6f3eb2bc065ed (diff) | |
download | gst-plugins-bad-25d2d8f48a1c0f9dcbeabfff01946389e3c469a8.tar.gz gst-plugins-bad-25d2d8f48a1c0f9dcbeabfff01946389e3c469a8.tar.bz2 gst-plugins-bad-25d2d8f48a1c0f9dcbeabfff01946389e3c469a8.zip |
ext/jack/: Query port latencies for sink/src delays.
Original commit message from CVS:
* ext/jack/gstjackaudiosink.c:
* ext/jack/gstjackaudiosrc.c:
Query port latencies for sink/src delays.
* ext/jack/gstjackbin.c:
No printf please.
Diffstat (limited to 'ext/jack')
-rw-r--r-- | ext/jack/gstjackaudiosink.c | 10 | ||||
-rw-r--r-- | ext/jack/gstjackaudiosrc.c | 10 | ||||
-rw-r--r-- | ext/jack/gstjackbin.c | 2 |
3 files changed, 19 insertions, 3 deletions
diff --git a/ext/jack/gstjackaudiosink.c b/ext/jack/gstjackaudiosink.c index 265ec68c..228a2297 100644 --- a/ext/jack/gstjackaudiosink.c +++ b/ext/jack/gstjackaudiosink.c @@ -594,9 +594,17 @@ static guint gst_jack_ring_buffer_delay (GstRingBuffer * buf) { GstJackAudioSink *sink; - guint res = 0; + guint i, res = 0, latency; + jack_client_t *client; sink = GST_JACK_AUDIO_SINK (GST_OBJECT_PARENT (buf)); + client = gst_jack_audio_client_get_client (sink->client); + + for (i = 0; i < sink->port_count; i++) { + latency = jack_port_get_total_latency (client, sink->ports[i]); + if (latency > res) + res = latency; + } GST_DEBUG_OBJECT (sink, "delay %u", res); diff --git a/ext/jack/gstjackaudiosrc.c b/ext/jack/gstjackaudiosrc.c index 6462d239..682a684a 100644 --- a/ext/jack/gstjackaudiosrc.c +++ b/ext/jack/gstjackaudiosrc.c @@ -601,9 +601,17 @@ static guint gst_jack_ring_buffer_delay (GstRingBuffer * buf) { GstJackAudioSrc *src; - guint res = 0; + guint i, res = 0, latency; + jack_client_t *client; src = GST_JACK_AUDIO_SRC (GST_OBJECT_PARENT (buf)); + client = gst_jack_audio_client_get_client (src->client); + + for (i = 0; i < src->port_count; i++) { + latency = jack_port_get_total_latency (client, src->ports[i]); + if (latency > res) + res = latency; + } GST_DEBUG_OBJECT (src, "delay %u", res); diff --git a/ext/jack/gstjackbin.c b/ext/jack/gstjackbin.c index 7b219c70..08fed371 100644 --- a/ext/jack/gstjackbin.c +++ b/ext/jack/gstjackbin.c @@ -337,7 +337,7 @@ static void shutdown (void *arg) { /* GstJackClient *client = (GstJackClient*) arg; */ - printf ("shutdown %p\n", arg); + JACK_DEBUG ("shutdown %p\n", arg); /* gst_element_set_state (GST_ELEMENT (client->manager), GST_STATE_READY); */ } |