Commit a43a8a5b 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 bc1b0ca3 3d2a5409
......@@ -185,8 +185,8 @@ AudioStream::createStream (pa_context* c)
// 2048 bytes (1024 int16) is 20 ms at 44100 Hz
if (_streamType == PLAYBACK_STREAM) {
attributes->maxlength = 32000;
attributes->tlength = 8192;
attributes->prebuf = 2048;
attributes->tlength = 16000;
attributes->prebuf = 1024;
attributes->minreq = 512;
attributes->fragsize = (uint32_t) -1;
pa_stream_connect_playback( s , NULL , attributes, PA_STREAM_INTERPOLATE_TIMING, &_volume, NULL);
......@@ -196,9 +196,9 @@ AudioStream::createStream (pa_context* c)
// attributes->maxlength = 66500;
// attributes->fragsize = (uint32_t)-1;
attributes->maxlength = 16000;
attributes->tlength = 8192;
attributes->prebuf = 2048;
attributes->maxlength = 32000;
attributes->tlength = 16000;
attributes->prebuf = 1024;
attributes->minreq = 512;
attributes->fragsize = (uint32_t) -1;
......
......@@ -57,8 +57,16 @@ static void stream_moved_callback(pa_stream *s UNUSED, void *userdata UNUSED)
static void playback_underflow_callback (pa_stream* s, void* userdata UNUSED)
{
_debug ("PulseLayer::Buffer Underflow\n");
SFLDataFormat* out = (SFLDataFormat*) pa_xmalloc (framesPerBuffer*sizeof(SFLDataFormat));
bzero (out, framesPerBuffer*sizeof(SFLDataFormat));
pa_stream_write (s, out, framesPerBuffer*sizeof(SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE);
pa_stream_trigger (s, NULL, NULL);
pa_xfree (out);
}
......@@ -485,9 +493,9 @@ void PulseLayer::writeToSpeaker (void)
{
toGet = framesPerBuffer;
toPlay = ( (int) (toGet * sizeof (SFLDataFormat)) > framesPerBuffer) ? framesPerBuffer : toGet * sizeof (SFLDataFormat);
toPlay = ( (int) (toGet * sizeof (SFLDataFormat)) > framesPerBuffer * sizeof (SFLDataFormat)) ? framesPerBuffer : toGet * sizeof (SFLDataFormat);
out = (SFLDataFormat*) pa_xmalloc (toPlay);
file_tone->getNext(out, toPlay/2 , 100);
file_tone->getNext(out, toPlay/sizeof(SFLDataFormat), 100);
pa_stream_write (playback->pulseStream(), out, toPlay, NULL, 0, PA_SEEK_RELATIVE);
pa_xfree (out);
......
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