diff --git a/sflphone-common/src/audio/alsa/alsalayer.cpp b/sflphone-common/src/audio/alsa/alsalayer.cpp index 97d3bf53f72afc22ecfd582a83c4b151779b7688..fcd22045b26058cafa629946837a5abface97557 100644 --- a/sflphone-common/src/audio/alsa/alsalayer.cpp +++ b/sflphone-common/src/audio/alsa/alsalayer.cpp @@ -862,7 +862,7 @@ void AlsaLayer::audioCallback (void) } else if (file_tone != 0) { out = (SFLDataFormat*) malloc (maxBytes * sizeof (SFLDataFormat)); - tone->getNext (out, toGet, spkrVolume); + file_tone->getNext(out, toGet, spkrVolume); write (out , maxBytes); free(out); diff --git a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp index c1712d6409bb1d1fc7e81d00d446078c9a5765bb..2ce375a3ca788d6e4d486fe37dd178190b3ed6cf 100644 --- a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp +++ b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp @@ -485,9 +485,8 @@ void PulseLayer::writeToSpeaker (void) toGet = framesPerBuffer; toPlay = ( (int) (toGet * sizeof (SFLDataFormat)) > framesPerBuffer) ? framesPerBuffer : toGet * sizeof (SFLDataFormat); - _debug("toPlay: %i\n", toPlay); out = (SFLDataFormat*) pa_xmalloc (toPlay); - file_tone->getNext (out, toPlay/2 , 100); + file_tone->getNext(out, toPlay/2 , 100); pa_stream_write (playback->pulseStream(), out, toPlay, NULL, 0, PA_SEEK_RELATIVE); pa_xfree (out); diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index f700f6351363a5ef91b9dca0425c57721f329072..5491f2fe9d44ecc3c7ad645ba6bda9daf1dc3a07 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -2030,10 +2030,11 @@ bool ManagerImpl::playATone (Tone::TONEID toneId) audiolayer = getAudioDriver(); - if (audiolayer) + + if (audiolayer) { audiolayer->startStream(); - - audiolayer->flushUrgent(); + audiolayer->flushUrgent(); + } if (_telephoneTone != 0) { _toneMutex.enterMutex(); @@ -2168,12 +2169,8 @@ ManagerImpl::ringtone() _audiofile.start(); _toneMutex.leaveMutex(); - if (CHECK_INTERFACE (layer, ALSA)) { - //ringback(); - - } else { - audiolayer->startStream(); - } + audiolayer->startStream(); + } else { ringback(); }