From f3eeb67c9ddc8925db293cd6cefe9e2b884c48eb Mon Sep 17 00:00:00 2001
From: Daniel Thor Kristjansson <danielk@cuymedia.net>
Date: Thu, 20 Dec 2012 10:47:58 -0500
Subject: [PATCH] Use jack_port_get_latency_range when available.
jack_port_get_total_latency() is depreciated.
---
mythtv/libs/libmyth/audio/audiooutputjack.cpp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/mythtv/libs/libmyth/audio/audiooutputjack.cpp b/mythtv/libs/libmyth/audio/audiooutputjack.cpp
index 533fceb..0f5c23b 100644
|
a
|
b
|
using namespace std;
|
| 14 | 14 | |
| 15 | 15 | #include "mythcorecontext.h" |
| 16 | 16 | #include "audiooutputjack.h" |
| | 17 | #include "mythconfig.h" // for HAVE_JACK_PORT_GET_LATENCY_RANGE |
| 17 | 18 | #include "mythdate.h" |
| 18 | 19 | |
| 19 | 20 | #define LOC QString("AOJack: ") |
| … |
… |
int AudioOutputJACK::_JackGraphOrderCallback(void *arg)
|
| 458 | 459 | int AudioOutputJACK::JackGraphOrderCallback(void) |
| 459 | 460 | { |
| 460 | 461 | int i; |
| 461 | | jack_nframes_t port_latency, max_latency = 0; |
| | 462 | jack_nframes_t max_latency = 0; |
| 462 | 463 | |
| 463 | 464 | for (i = 0; i < channels; ++i) |
| 464 | 465 | { |
| 465 | | port_latency = jack_port_get_total_latency( client, ports[i] ); |
| | 466 | #ifdef HAVE_JACK_PORT_GET_LATENCY_RANGE |
| | 467 | jack_latency_range_t range; |
| | 468 | jack_port_get_latency_range( |
| | 469 | ports[i], JackPlaybackLatency, &range); |
| | 470 | jack_nframes_t port_latency = range.max; |
| | 471 | #else |
| | 472 | jack_nframes_t port_latency = |
| | 473 | jack_port_get_total_latency(client, ports[i]); |
| | 474 | #endif |
| 466 | 475 | if (port_latency > max_latency) |
| 467 | 476 | max_latency = port_latency; |
| 468 | 477 | } |