Commit 34dd2ffe authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3443] Reset audio sampling rate fo filetone, and DTMF generator

parent 4b951b37
...@@ -65,7 +65,7 @@ void AudioThread::run (void) ...@@ -65,7 +65,7 @@ void AudioThread::run (void)
{ {
while (!testCancel()) { while (!testCancel()) {
_alsa->audioCallback(); _alsa->audioCallback();
Thread::sleep (20); Thread::sleep (5);
} }
} }
...@@ -131,7 +131,7 @@ void ManagerImpl::init () { ...@@ -131,7 +131,7 @@ void ManagerImpl::init () {
AudioLayer *audiolayer = getAudioDriver(); AudioLayer *audiolayer = getAudioDriver();
if (audiolayer != 0) { if (audiolayer) {
unsigned int sampleRate = audiolayer->getSampleRate(); unsigned int sampleRate = audiolayer->getSampleRate();
_debugInit ("Manager: Load telephone tone"); _debugInit ("Manager: Load telephone tone");
...@@ -142,9 +142,6 @@ void ManagerImpl::init () { ...@@ -142,9 +142,6 @@ void ManagerImpl::init () {
_dtmfKey = new DTMF(sampleRate); _dtmfKey = new DTMF(sampleRate);
} }
if (audiolayer == 0)
audiolayer->stopStream();
// Load the history // Load the history
_history->load_history(getConfigInt(PREFERENCES, CONFIG_HISTORY_LIMIT)); _history->load_history(getConfigInt(PREFERENCES, CONFIG_HISTORY_LIMIT));
} }
...@@ -2958,6 +2955,22 @@ void ManagerImpl::audioSamplingRateChanged (void) { ...@@ -2958,6 +2955,22 @@ void ManagerImpl::audioSamplingRateChanged (void) {
_debug ("Manager: Current device: %i ", type); _debug ("Manager: Current device: %i ", type);
_debug ("Manager: Has current call: %i ", hasCurrentCall()); _debug ("Manager: Has current call: %i ", hasCurrentCall());
if (_audiodriver) {
unsigned int sampleRate = _audiodriver->getSampleRate();
delete _telephoneTone;
_debugInit ("Manager: Load telephone tone");
std::string country = getConfigString(PREFERENCES, ZONE_TONE);
_telephoneTone = new TelephoneTone(country, sampleRate);
delete _dtmfKey;
_debugInit ("Manager: Loading DTMF key");
_dtmfKey = new DTMF(sampleRate);
}
if (hasCurrentCall()) if (hasCurrentCall())
_audiodriver->startStream(); _audiodriver->startStream();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment