summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniels <niels@dyne.org>2015-07-30 20:11:35 (GMT)
committer niels <niels@dyne.org>2015-07-30 20:11:35 (GMT)
commit424c88a81ab20c03fcd65076865d98eac38e4cbf (patch)
tree216706739d2bc43aabadce2e514a37168c5714ec
parentab7969db1bf3e73f7030b57760048822cce1cb3e (diff)
fix deprecated warnings related to jack in bio2backv1.5.54
-rw-r--r--veejay-current/veejay-server/bio2jack/bio2jack.c52
-rw-r--r--veejay-current/veejay-server/configure.ac11
2 files changed, 49 insertions, 14 deletions
diff --git a/veejay-current/veejay-server/bio2jack/bio2jack.c b/veejay-current/veejay-server/bio2jack/bio2jack.c
index 725989f..e00c3dd 100644
--- a/veejay-current/veejay-server/bio2jack/bio2jack.c
+++ b/veejay-current/veejay-server/bio2jack/bio2jack.c
@@ -860,16 +860,21 @@ JACK_OpenDevice(jack_driver_t * drv)
drv->deviceID, drv->clientCtr++);
/* try to become a client of the JACK server */
- TRACE("client name '%s'\n", our_client_name);
- /*
+ TRACE("client name '%s'\n", our_client_name);
+#ifndef HAVE_JACK2
if((drv->client = jack_client_new(our_client_name)) == 0)
-*/
+#else
if( (drv->client = jack_client_open( our_client_name, JackNullOption | JackNoStartServer, NULL ) ) == 0 )
+#endif
{
/* try once more */
TRACE("trying once more to jack_client_new");
- if((drv->client = jack_client_new(our_client_name)) == 0)
- {
+#ifndef HAVE_JACK2
+ if((drv->client = jack_client_new(our_client_name)) == 0)
+#else
+ if( (drv->client = jack_client_open( our_client_name, JackNullOption, NULL )) == 0)
+#endif
+ {
ERR("jack server not running?");
free(our_client_name);
return ERR_OPENING_JACK;
@@ -1502,16 +1507,29 @@ JACK_OpenEx(int *deviceID, unsigned int bits_per_channel,
/* FIXME: maybe we should keep different latency values for input vs output? */
if(drv->num_output_channels > 0)
{
+#ifdef HAVE_JACK_PORT_GET_LATENCY_RANGE
+ jack_latency_range_t r;
+ jack_port_get_latency_range( drv->output_port[0], JackCaptureLatency, &r );
+ periods += r.max;
+#else
periods = jack_port_get_total_latency(drv->client,
drv->output_port[0]) / periodSize;
- drv->latencyMS = periodSize * periods * 1000 / (drv->jack_sample_rate *
+#endif
+ drv->latencyMS = periodSize * periods * 1000 / (drv->jack_sample_rate *
(drv->bits_per_channel / 8 *
drv->num_output_channels));
}
else if(drv->num_input_channels > 0)
{
+#ifdef HAVE_JACK_PORT_GET_LATENCY_RANGE
+ jack_latency_range_t r;
+ jack_port_get_latency_range( drv->output_port[0], JackCaptureLatency, &r );
+ periods += r.max;
+#else
+
periods = jack_port_get_total_latency(drv->client,
drv->input_port[0]) / periodSize;
+#endif
drv->latencyMS =
periodSize * periods * 1000 / (drv->jack_sample_rate *
(drv->bits_per_channel / 8 *
@@ -2402,9 +2420,15 @@ JACK_GetJackOutputLatency(int deviceID)
jack_driver_t *drv = getDriver(deviceID);
long return_val = 0;
- if(drv->client && drv->num_output_channels)
- return_val = jack_port_get_total_latency(drv->client, drv->output_port[0]);
-
+ if(drv->client && drv->num_output_channels) {
+#ifdef HAVE_JACK_PORT_GET_LATENCY_RANGE
+ jack_latency_range_t r;
+ jack_port_get_latency_range( drv->output_port[0], JackCaptureLatency, &r );
+ return_val = r.max;
+#else
+ return_val = jack_port_get_total_latency(drv->client, drv->output_port[0]);
+#endif
+ }
TRACE("got latency of %ld frames\n", return_val);
releaseDriver(drv);
@@ -2418,9 +2442,15 @@ JACK_GetJackInputLatency(int deviceID)
jack_driver_t *drv = getDriver(deviceID);
long return_val = 0;
- if(drv->client && drv->num_input_channels)
+ if(drv->client && drv->num_input_channels) {
+#ifdef HAVE_JACK_PORT_GET_LATENCY_RANGE
+ jack_latency_range_t r;
+ jack_port_get_latency_range( drv->output_port[0], JackCaptureLatency, &r );
+ return_val = r.max;
+#else
return_val = jack_port_get_total_latency(drv->client, drv->input_port[0]);
-
+#endif
+ }
TRACE("got latency of %ld frames\n", return_val);
releaseDriver(drv);
diff --git a/veejay-current/veejay-server/configure.ac b/veejay-current/veejay-server/configure.ac
index f7b64f7..a99220e 100644
--- a/veejay-current/veejay-server/configure.ac
+++ b/veejay-current/veejay-server/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
dnl AC_INIT
-AC_INIT([veejay],[1.5.53],[http://www.veejayhq.net])
+AC_INIT([veejay],[1.5.54],[http://www.veejayhq.net])
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([veejay/veejay.c])
@@ -924,8 +924,13 @@ if test x$with_jack != xno ; then
if test x$have_jack = xtrue ; then
AC_SUBST(JACK_LIBS)
AC_SUBST(JACK_CFLAGS)
- AC_DEFINE(HAVE_JACK,1,[Compiling in Jack])
- fi
+ AC_SEARCH_LIBS(jack_port_get_latency_range,jack,
+ [AC_DEFINE(HAVE_JACK_PORT_GET_LATENCY_RANGE, 1, [jack_port_get_latency_range present in libjack])],
+ [])
+ AC_DEFINE(HAVE_JACK,1,[Compiling in Jack])
+ AC_SEARCH_LIBS(jack_client_open,jack,
+ [AC_DEFINE(HAVE_JACK2,1,[newer jack versions])],[])
+ fi
fi
dnl ********************************************************************