Commit e69713b2 authored by Emmanuel Milou's avatar Emmanuel Milou

Merge branch 'master' of...

Merge branch 'master' of git+ssh://repos-sflphone-git@git.sflphone.org/var/repos/sflphone/git/sflphone
parents a1e8177e fda3805c
......@@ -200,7 +200,7 @@ AudioStream::createStream (pa_context* c)
attributes->tlength = (uint32_t)-1;
attributes->prebuf = (uint32_t)-1;
attributes->minreq = (uint32_t)-1;
attributes->fragsize = (uint32_t)-1;
attributes->fragsize = 4096;
// pa_stream_connect_record (s , NULL , attributes , PA_STREAM_START_CORKED);
// pa_stream_connect_record( s , NULL , attributes , PA_STREAM_INTERPOLATE_TIMING );
......
......@@ -524,10 +524,14 @@ void PulseLayer::writeToSpeaker (void)
int maxNbSamplesToGet = 0;
int maxNbBytesToGet = 0;
// test if audio resampling is needed
if (_mainBufferSampleRate && ((int)_audioSampleRate != _mainBufferSampleRate)) {
// upsamplefactor is used to compute the number of bytes to get in the ring buffer
double upsampleFactor = (double) _mainBufferSampleRate / _audioSampleRate;
// maxNbSamplesToGet is the number of sample to get in the ring buffer which,
// once resampled, will not be over the framesPerBuffer
maxNbSamplesToGet = (int) ((double) framesPerBuffer * upsampleFactor);
} else {
......@@ -595,7 +599,7 @@ void PulseLayer::writeToSpeaker (void)
void PulseLayer::readFromMic (void)
{
const char* data;
const char* data = NULL;
size_t r;
if (pa_stream_peek (record->pulseStream() , (const void**) &data , &r) < 0 || !data) {
......
Markdown is supported
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