From 1c4f06ff5e3744bc84b1914982230080128e4875 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 26 Jul 2009 07:29:32 +0000 Subject: [PATCH] some linux compilation fixes --- linux/Makefile.am | 9 +++++++-- linux/sound.cpp | 6 +++--- src/channel.cpp | 4 ++++ src/channel.h | 6 +++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/linux/Makefile.am b/linux/Makefile.am index b24eeaf4..07796908 100755 --- a/linux/Makefile.am +++ b/linux/Makefile.am @@ -1,5 +1,10 @@ -#SUBDIRS = ../libs/celt/libcelt +# First compile additional libraries where the code is in our repository ------- +# CELT +SUBDIRS = ../libs/celt/libcelt +LIB_INCL_DIRS = -I../libs/celt/libcelt + +# Now we can deal with the actual llcon code ----------------------------------- bin_PROGRAMS = llcon llcon_SOURCES = ../src/buffer.cpp \ @@ -185,4 +190,4 @@ moc/resources.cpp: ../src/resources.qrc $(QT_RCC) ../src/resources.qrc -o moc/resources.cpp -llcon_CXXFLAGS=-I../src $(QT_CFLAGS) -DQT_THREAD_SUPPORT -D_REENTRANT -g +llcon_CXXFLAGS=-I../src $(LIB_INCL_DIRS) $(QT_CFLAGS) -DQT_THREAD_SUPPORT -D_REENTRANT -g diff --git a/linux/sound.cpp b/linux/sound.cpp index 58acba2e..e8acfbf8 100755 --- a/linux/sound.cpp +++ b/linux/sound.cpp @@ -36,7 +36,7 @@ void CSound::OpenJack() jack_on_shutdown ( pJackClient, shutdownCallback, this ); // TEST check sample rate, if not correct, just fire error -if ( jack_get_sample_rate ( pJackClient ) != SND_CRD_SAMPLE_RATE ) +if ( jack_get_sample_rate ( pJackClient ) != SYSTEM_SAMPLE_RATE ) { throw CGenErr ( "Jack server sample rate is different from " "required one" ); @@ -501,13 +501,13 @@ bool CSound::SetHWParams ( snd_pcm_t* handle, const int iDesiredBufferSize, // restrict a configuration space to have rate nearest to a target: // set the sample-rate - unsigned int rrate = SND_CRD_SAMPLE_RATE; + unsigned int rrate = SYSTEM_SAMPLE_RATE; if ( err = snd_pcm_hw_params_set_rate_near ( handle, hwparams, &rrate, 0 ) < 0 ) { qDebug ( "Rate %iHz not available : %s", rrate, snd_strerror ( err ) ); return true; } - if ( rrate != SND_CRD_SAMPLE_RATE ) // check if rate is possible + if ( rrate != SYSTEM_SAMPLE_RATE ) // check if rate is possible { qDebug ( "Rate doesn't match (requested %iHz, get %iHz)", rrate, err ); return true; diff --git a/src/channel.cpp b/src/channel.cpp index 7c63d759..44450067 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -983,6 +983,10 @@ EGetDataStat CChannel::GetData ( CVector& vecbyData ) // time out counter is based on samples not on blocks (definition: // always one atomic block is get by using the GetData() function // where the atomic block size is "SYSTEM_BLOCK_SIZE_SAMPLES") + +// TODO this code only works with the above assumption -> better +// implementation so that we are not depending on assumptions + iConTimeOut -= SYSTEM_BLOCK_SIZE_SAMPLES; if ( iConTimeOut <= 0 ) diff --git a/src/channel.h b/src/channel.h index 76ddb859..a2b692e3 100755 --- a/src/channel.h +++ b/src/channel.h @@ -86,7 +86,7 @@ public: void SetAddress ( const CHostAddress NAddr ) { InetAddr = NAddr; } bool GetAddress ( CHostAddress& RetAddr ); - CHostAddress GetAddress() { return InetAddr; } + CHostAddress GetAddress() const { return InetAddr; } void SetName ( const QString sNNa ); QString GetName(); @@ -101,7 +101,7 @@ public: { Protocol.CreateChanGainMes ( iId, dGain ); } bool SetSockBufSize ( const int iNumBlocks ); - int GetSockBufSize() { return iCurSockBufSize; } + int GetSockBufSize() const { return iCurSockBufSize; } int GetAudioBlockSizeIn() { return NetwBufferInProps.iAudioBlockSize; } int GetUploadRateKbps(); @@ -109,7 +109,7 @@ public: double GetTimingStdDev() { return CycleTimeVariance.GetStdDev(); } void SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut ); - int GetNetwBufSizeFactOut() { return iCurNetwOutBlSiFact; } + int GetNetwBufSizeFactOut() const { return iCurNetwOutBlSiFact; } // network protocol interface void CreateJitBufMes ( const int iJitBufSize )