Ticket #11301: 0001-Use-jack_port_get_latency_range-when-available.patch

File 0001-Use-jack_port_get_latency_range-when-available.patch, 1.6 KB (added by danielk, 8 years ago)
  • mythtv/libs/libmyth/audio/audiooutputjack.cpp

    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; 
    1414
    1515#include "mythcorecontext.h"
    1616#include "audiooutputjack.h"
     17#include "mythconfig.h" // for HAVE_JACK_PORT_GET_LATENCY_RANGE
    1718#include "mythdate.h"
    1819
    1920#define LOC QString("AOJack: ")
    int AudioOutputJACK::_JackGraphOrderCallback(void *arg) 
    458459int AudioOutputJACK::JackGraphOrderCallback(void)
    459460{
    460461    int i;
    461     jack_nframes_t port_latency, max_latency = 0;
     462    jack_nframes_t max_latency = 0;
    462463
    463464    for (i = 0; i < channels; ++i)
    464465    {
    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
    466475        if (port_latency > max_latency)
    467476            max_latency = port_latency;
    468477    }