From 31b099d74efc79d1ce7eb7972ec7e51f32a1609d Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 4 Jan 2010 14:14:28 +0100 Subject: [PATCH] AudioJack: more optional code for AudioPort support There's been some more code that is only required if AUDIO_PORT_SUPPORT is set. Added according #ifdefs and fixed a typo in AudioPort support code. (cherry picked from commit e98726ae992c77fb2dfdb6668319b5521ff8aaef) --- include/AudioJack.h | 2 ++ src/core/audio/AudioJack.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/AudioJack.h b/include/AudioJack.h index 86217d1ae..33673fab5 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -109,6 +109,7 @@ private: f_cnt_t m_framesToDoInCurBuf; +#ifdef AUDIO_PORT_SUPPORT struct StereoPort { jack_port_t * ports[2]; @@ -117,6 +118,7 @@ private: typedef QMap JackPortMap; JackPortMap m_portMap; #endif +#endif signals: void zombified(); diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index 9eb0856f5..91a32fe05 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -75,10 +75,12 @@ AudioJack::~AudioJack() { m_stopSemaphore.release(); +#ifdef AUDIO_PORT_SUPPORT while( m_portMap.size() ) { unregisterPort( m_portMap.begin().key() ); } +#endif if( m_client != NULL ) { @@ -342,7 +344,7 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata ) #ifdef AUDIO_PORT_SUPPORT const Uint32 frames = qMin( _nframes, mixer()->framesPerPeriod() ); - for( jackPortMap::iterator it = m_portMap.begin(); + for( JackPortMap::Iterator it = m_portMap.begin(); it != m_portMap.end(); ++it ) { for( ch_cnt_t ch = 0; ch < channels(); ++ch )