From 1fe0c689b08a361361d066e10b4bcf77feb2ea50 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 12 Aug 2009 11:47:35 +0200 Subject: [PATCH] AudioJACK: removed incorret JACK transport code The audio_jack driver currently treats the jack transport status as a flag for whether or not to output audio. This is incorrect and unintended usage of jack transport. The attached patch simply removes all references to jack transport from the driver, so that LMMS will always be able to produce audio. Closes #2816029. --- src/core/audio/audio_jack.cpp | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/core/audio/audio_jack.cpp b/src/core/audio/audio_jack.cpp index 27117a307..ae26d460a 100644 --- a/src/core/audio/audio_jack.cpp +++ b/src/core/audio/audio_jack.cpp @@ -2,7 +2,7 @@ * audio_jack.cpp - support for JACK-transport * * Copyright (c) 2005-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -213,13 +213,6 @@ void audioJACK::startProcessing( void ) m_active = true; - // make sure, JACK transport is rolling - if( jack_transport_query( m_client, NULL ) != JackTransportRolling ) - { - jack_transport_start( m_client ); - } - - // try to sync JACK's and LMMS's buffer-size // jack_set_buffer_size( m_client, getMixer()->framesPerPeriod() ); @@ -343,8 +336,6 @@ void audioJACK::renamePort( audioPort * _port ) int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) { - jack_transport_state_t ts = jack_transport_query( m_client, NULL ); - QVector outbufs( channels(), NULL ); ch_cnt_t chnl = 0; for( QVector::iterator it = @@ -385,19 +376,16 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) _nframes, m_framesToDoInCurBuf - m_framesDoneInCurBuf ); - if( ts == JackTransportRolling ) + const float gain = getMixer()->masterGain(); + for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) { - const float gain = getMixer()->masterGain(); - for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) + jack_default_audio_sample_t * o = outbufs[chnl]; + for( jack_nframes_t frame = 0; frame < todo; + ++frame ) { - jack_default_audio_sample_t * o = outbufs[chnl]; - for( jack_nframes_t frame = 0; frame < todo; - ++frame ) - { - o[done+frame] = - m_outBuf[m_framesDoneInCurBuf+ - frame][chnl] * gain; - } + o[done+frame] = + m_outBuf[m_framesDoneInCurBuf+ + frame][chnl] * gain; } } done += todo; @@ -414,7 +402,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) } } - if( ts != JackTransportRolling || m_stopped == true ) + if( m_stopped == true ) { for( ch_cnt_t ch = 0; ch < channels(); ++ch ) {