diff --git a/sflphone-common/src/audio/audiolayer.cpp b/sflphone-common/src/audio/audiolayer.cpp index 9f1119ff694baf871e77d9fa9c17b4b13818a667..8966eb6aba086a30183d9dfa048ec3d42f5350f8 100644 --- a/sflphone-common/src/audio/audiolayer.cpp +++ b/sflphone-common/src/audio/audiolayer.cpp @@ -24,13 +24,13 @@ void AudioLayer::flushMain (void) ost::MutexLock guard (_mutex); // should pass call id - _mainBuffer.flush(); + _mainBuffer.flushAllBuffers(); } void AudioLayer::flushUrgent (void) { ost::MutexLock guard (_mutex); - _urgentRingBuffer.flush(); + _urgentRingBuffer.flushAll(); } void AudioLayer::flushMic (void) diff --git a/sflphone-common/src/audio/audiortp/AudioRtpSession.h b/sflphone-common/src/audio/audiortp/AudioRtpSession.h index bed84b1c3d3956e64170e2e2507f2dc14e0f9967..3ac8916b3aa4dbb20093b47d40500406647156ec 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioRtpSession.h @@ -498,10 +498,12 @@ namespace sfl { } _ca->setRecordingSmplRate(_audiocodec->getClockRate()); - + _audiolayer->startStream(); static_cast<D*>(this)->startRunning(); + _audiolayer->flushUrgent(); + _debug ("Entering RTP mainloop for callid %s\n",_ca->getCallId().c_str()); while (!testCancel()) { diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 052b87fadfaf8a41f3f7ab0a8ed4975257674b83..006ef35f3e484af38afcd88237645ed545e16460 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -372,6 +372,7 @@ ManagerImpl::answerCall (const CallID& call_id) } + if (!getAccountLink (account_id)->answer (call_id)) { // error when receiving... removeCallAccount (call_id); @@ -777,7 +778,7 @@ ManagerImpl::refuseCall (const CallID& id) AccountID accountid; bool returnValue; - stopTone (true); + stopTone (false); int nbCalls = getCallList().size(); @@ -1700,6 +1701,8 @@ ManagerImpl::playDtmf (char code, bool isTalking) // Put buffer to urgentRingBuffer // put the size in bytes... // so size * 1 channel (mono) * sizeof (bytes for the data) + audiolayer->flushUrgent(); + audiolayer->startStream(); audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat)); } @@ -2030,6 +2033,8 @@ bool ManagerImpl::playATone (Tone::TONEID toneId) if (audiolayer) audiolayer->startStream(); + audiolayer->flushUrgent(); + if (_telephoneTone != 0) { _toneMutex.enterMutex(); _telephoneTone->setCurrentTone (toneId); @@ -2039,6 +2044,7 @@ bool ManagerImpl::playATone (Tone::TONEID toneId) nbSamples = audioloop->getSize(); SFLDataFormat buf[nbSamples]; + if (audiolayer) { audiolayer->putUrgent (buf, nbSamples); } else @@ -2218,6 +2224,7 @@ void ManagerImpl::notificationIncomingCall (void) SFLDataFormat buf[nbSampling]; tone.getNext (buf, tone.getSize()); /* Put the data in the urgent ring buffer */ + audiolayer->flushUrgent(); audiolayer->putUrgent (buf, sizeof (SFLDataFormat) *nbSampling); } }