Skip to content
Snippets Groups Projects
Commit 41ac872d authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6629 : keep the correct audio module when frequency changes

parent 1756c278
No related branches found
No related tags found
No related merge requests found
...@@ -123,35 +123,19 @@ void ManagerImpl::init (std::string config_file) ...@@ -123,35 +123,19 @@ void ManagerImpl::init (std::string config_file)
audioLayerMutexLock(); audioLayerMutexLock();
if (_audiodriver) { if (_audiodriver) {
unsigned int sampleRate = _audiodriver->getSampleRate(); _telephoneTone = new TelephoneTone (preferences.getZoneToneChoice(), _audiodriver->getSampleRate());
_dtmfKey = new DTMF (8000);
_debug ("Manager: Load telephone tone");
std::string country(preferences.getZoneToneChoice());
_telephoneTone = new TelephoneTone (country, sampleRate);
_debug ("Manager: Loading DTMF key (%d)", sampleRate);
sampleRate = 8000;
_dtmfKey = new DTMF (sampleRate);
} }
audioLayerMutexUnlock(); audioLayerMutexUnlock();
// Load the history
_history->load_history (preferences.getHistoryLimit()); _history->load_history (preferences.getHistoryLimit());
// Init the instant messaging module
_imModule->init(); _imModule->init();
// Register accounts
registerAccounts(); registerAccounts();
} }
void ManagerImpl::terminate () void ManagerImpl::terminate ()
{ {
_debug ("Manager: Terminate ");
std::vector<std::string> callList(getCallList()); std::vector<std::string> callList(getCallList());
_debug ("Manager: Hangup %zu remaining call", callList.size()); _debug ("Manager: Hangup %zu remaining call", callList.size());
...@@ -2334,8 +2318,6 @@ void ManagerImpl::setMailNotify (void) ...@@ -2334,8 +2318,6 @@ void ManagerImpl::setMailNotify (void)
void ManagerImpl::setAudioManager (int32_t api) void ManagerImpl::setAudioManager (int32_t api)
{ {
_debug ("Manager: Setting audio manager ");
audioLayerMutexLock(); audioLayerMutexLock();
if (!_audiodriver) { if (!_audiodriver) {
...@@ -2481,13 +2463,11 @@ void ManagerImpl::initAudioDriver (void) ...@@ -2481,13 +2463,11 @@ void ManagerImpl::initAudioDriver (void)
void ManagerImpl::switchAudioManager (void) void ManagerImpl::switchAudioManager (void)
{ {
_debug ("Manager: Switching audio manager ");
audioLayerMutexLock(); audioLayerMutexLock();
bool wasStarted = _audiodriver->isStarted(); bool wasStarted = _audiodriver->isStarted();
int newType = (_audiodriver->getLayerType()) == PULSEAUDIO ? ALSA : PULSEAUDIO; int newType = (_audiodriver->getLayerType() == PULSEAUDIO) ? ALSA : PULSEAUDIO;
delete _audiodriver; delete _audiodriver;
if (newType == ALSA) if (newType == ALSA)
...@@ -2533,9 +2513,9 @@ void ManagerImpl::audioSamplingRateChanged (int samplerate) ...@@ -2533,9 +2513,9 @@ void ManagerImpl::audioSamplingRateChanged (int samplerate)
delete _audiodriver; delete _audiodriver;
if (type == PULSEAUDIO) if (type == PULSEAUDIO)
_audiodriver = new AlsaLayer;
else
_audiodriver = new PulseLayer; _audiodriver = new PulseLayer;
else
_audiodriver = new AlsaLayer;
unsigned int sampleRate = _audiodriver->getSampleRate(); unsigned int sampleRate = _audiodriver->getSampleRate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment