Commit 95446226 authored by Philippe Normand's avatar Philippe Normand Committed by Tim-Philipp Müller

jack: fix build against jack 0.120.2

jack_port_get_total_latency() has been deprecated in favor of
jack_port_get_latency_range().

https://bugzilla.gnome.org/show_bug.cgi?id=644477
parent 32afdea9
......@@ -766,6 +766,12 @@ AG_GST_CHECK_FEATURE(JACK, Jack, jack, [
PKG_CHECK_MODULES(JACK, jack >= 0.99.10, HAVE_JACK="yes", HAVE_JACK="no")
AC_SUBST(JACK_CFLAGS)
AC_SUBST(JACK_LIBS)
AG_GST_PKG_CHECK_MODULES(JACK_0_120_2, jack >= 0.120.2)
if test x$HAVE_JACK_0_120_2 = xyes; then
AC_DEFINE(HAVE_JACK_0_120_2, 1, [defined if jack >= 0.120.2 is available])
fi
])
dnl *** jpeg ***
......
......@@ -592,16 +592,27 @@ static guint
gst_jack_ring_buffer_delay (GstRingBuffer * buf)
{
GstJackAudioSink *sink;
guint i, res = 0, latency;
guint i, res = 0;
#ifdef HAVE_JACK_0_120_2
jack_latency_range_t range;
#else
guint latency;
#endif
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]);
#ifdef HAVE_JACK_0_120_2
jack_port_get_latency_range (sink->ports[i], JackPlaybackLatency, &range);
if (range.max > res)
res = range.max;
#else
latency = jack_port_get_total_latency (client, src->ports[i]);
if (latency > res)
res = latency;
#endif
}
GST_LOG_OBJECT (sink, "delay %u", res);
......
......@@ -603,16 +603,27 @@ static guint
gst_jack_ring_buffer_delay (GstRingBuffer * buf)
{
GstJackAudioSrc *src;
guint i, res = 0, latency;
guint i, res = 0;
#ifdef HAVE_JACK_0_120_2
jack_latency_range_t range;
#else
guint latency;
#endif
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++) {
#ifdef HAVE_JACK_0_120_2
jack_port_get_latency_range (src->ports[i], JackCaptureLatency, &range);
if (range.max > res)
res = range.max;
#else
latency = jack_port_get_total_latency (client, src->ports[i]);
if (latency > res)
res = latency;
#endif
}
GST_DEBUG_OBJECT (src, "delay %u", res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment