Skip to content
Snippets Groups Projects
Commit 598b836c authored by llea's avatar llea
Browse files

Fix compilation without -alsa

parent 379990ae
No related branches found
No related tags found
No related merge requests found
......@@ -68,13 +68,13 @@ AudioRtp::createNewSession (SipCall *ca) {
symetric = true;
}
if (manager->useAlsa) {
#ifdef ALSA
RTXThread = new AudioRtpRTX (ca, manager->audiodriver,
manager->audiodriverReadAlsa, manager, symetric);
} else {
#else
RTXThread = new AudioRtpRTX (ca, manager->audiodriver, NULL, manager,
symetric);
}
#endif
if (RTXThread->start() != 0) {
return -1;
......@@ -110,8 +110,9 @@ AudioRtpRTX::AudioRtpRTX (SipCall *sipcall, AudioDrivers *driver,
this->ca = sipcall;
this->sym =sym;
this->audioDevice = driver;
if (manager->useAlsa)
#ifdef ALSA
this->audioDeviceRead = read_driver;
#endif
// TODO: Change bind address according to user settings.
InetHostAddress local_ip("0.0.0.0");
......@@ -254,18 +255,19 @@ AudioRtpRTX::run (void) {
// Send session
////////////////////////////
if (!manager->mute) {
if (manager->useAlsa) {
#ifdef ALSA
i = audioDeviceRead->readBuffer (data_from_mic, 320);
} else {
#else
i = audioDevice->readBuffer (data_from_mic, 320);
}
#endif
} else {
// When IP-phone user click on mute button, we read buffer of a
// temp buffer to avoid delay in sound.
if (manager->useAlsa)
#ifdef
i = audioDeviceRead->readBuffer (data_mute, 320);
else
#else
i = audioDevice->readBuffer (data_mute, 320);
#endif
}
// TODO : return an error because no sound
......
......@@ -141,12 +141,10 @@ Manager::createSettingsPath (void) {
void
Manager::selectAudioDriver (void) {
if (Config::getb("Audio", "Drivers.driverOSS")) {
useAlsa = false;
this->audiodriver = new AudioDriversOSS (AudioDrivers::ReadWrite);
}
if (Config::getb("Audio", "Drivers.driverALSA")) {
#ifdef ALSA
useAlsa = true;
this->audiodriver = new AudioDriversALSA (AudioDrivers::WriteOnly);
this->audiodriverReadAlsa = new AudioDriversALSA (AudioDrivers::ReadOnly);
#endif
......
......@@ -46,7 +46,6 @@ public:
#ifdef ALSA
AudioDrivers *audiodriverReadAlsa;
#endif
bool useAlsa;
ToneGenerator *tone;
QString *DirectCall; // from -p argv
bool mute;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment