aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-08-02 17:24:40 -0700
committerChris Robinson <[email protected]>2010-08-02 17:24:40 -0700
commitee61f7a55caabec6f9c1394ce84e343d940cab92 (patch)
tree3f24755639dbe236eb6aef5f23c74948f6776922 /Alc
parent241ddf76d4e3b7b0efd771bbc8270e1da2a7ca72 (diff)
Make sure to request a tlength that's at least minreq*2
And warn if Pulse returns a minreq that's too large
Diffstat (limited to 'Alc')
-rw-r--r--Alc/pulseaudio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index 1fa16d7e..b5e6f4ab 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -326,8 +326,11 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{
data->attr = *(ppa_stream_get_buffer_attr(stream));
Device->UpdateSize = data->attr.minreq / data->frame_size;
Device->NumUpdates = (data->attr.tlength/data->frame_size) / Device->UpdateSize;
- if(Device->NumUpdates == 0)
+ if(Device->NumUpdates <= 1)
+ {
Device->NumUpdates = 1;
+ AL_PRINT("PulseAudio returned tlength < minreq*2; expect break up\n");
+ }
ProcessContext(NULL);
}//}}}
@@ -879,6 +882,8 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
data->attr.fragsize = -1;
data->attr.minreq = device->UpdateSize * data->frame_size;
data->attr.tlength = data->attr.minreq * device->NumUpdates;
+ if(data->attr.tlength < data->attr.minreq*2)
+ data->attr.tlength = data->attr.minreq*2;
data->attr.maxlength = data->attr.tlength;
flags |= PA_STREAM_EARLY_REQUESTS;
flags |= PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE;