Skip to content
Snippets Groups Projects
Commit fda3805c authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'conference'

parents c6c32dc8 edfe125d
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment