mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
pacat: use fully automatic buffer sizes if possible
This commit is contained in:
parent
e2899f8bf3
commit
1a6974a1e2
1 changed files with 9 additions and 5 deletions
|
|
@ -430,14 +430,18 @@ static void context_state_callback(pa_context *c, void *userdata) {
|
||||||
pa_stream_set_event_callback(stream, stream_event_callback, NULL);
|
pa_stream_set_event_callback(stream, stream_event_callback, NULL);
|
||||||
pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL);
|
pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL);
|
||||||
|
|
||||||
if (latency > 0) {
|
pa_zero(buffer_attr);
|
||||||
memset(&buffer_attr, 0, sizeof(buffer_attr));
|
|
||||||
buffer_attr.tlength = (uint32_t) latency;
|
|
||||||
buffer_attr.minreq = (uint32_t) process_time;
|
|
||||||
buffer_attr.maxlength = (uint32_t) -1;
|
buffer_attr.maxlength = (uint32_t) -1;
|
||||||
buffer_attr.prebuf = (uint32_t) -1;
|
buffer_attr.prebuf = (uint32_t) -1;
|
||||||
buffer_attr.fragsize = (uint32_t) latency;
|
|
||||||
|
if (latency > 0) {
|
||||||
|
buffer_attr.fragsize = buffer_attr.tlength = (uint32_t) latency;
|
||||||
|
buffer_attr.minreq = (uint32_t) process_time;
|
||||||
flags |= PA_STREAM_ADJUST_LATENCY;
|
flags |= PA_STREAM_ADJUST_LATENCY;
|
||||||
|
} else {
|
||||||
|
buffer_attr.tlength = (uint32_t) -1;
|
||||||
|
buffer_attr.minreq = (uint32_t) -1;
|
||||||
|
buffer_attr.fragsize = (uint32_t) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == PLAYBACK) {
|
if (mode == PLAYBACK) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue