mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 16:18:16 +00:00
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
This commit is contained in:
parent
32afdea96d
commit
9544622674
3 changed files with 31 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue