mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
protocol-native: Ensure tlength is not set higher than maxlength
Tlength should never be set higher than maxlength. While this is corrected by memblockq later, we still need a correct tlength for the subsequent calculations. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
450747cf22
commit
2026c41be6
1 changed files with 2 additions and 0 deletions
|
|
@ -936,6 +936,8 @@ static void fix_playback_buffer_attr(playback_stream *s) {
|
|||
s->buffer_attr.tlength = (uint32_t) pa_usec_to_bytes_round_up(DEFAULT_TLENGTH_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
|
||||
if (s->buffer_attr.tlength <= 0)
|
||||
s->buffer_attr.tlength = (uint32_t) frame_size;
|
||||
if (s->buffer_attr.tlength > s->buffer_attr.maxlength)
|
||||
s->buffer_attr.tlength = s->buffer_attr.maxlength;
|
||||
|
||||
if (s->buffer_attr.minreq == (uint32_t) -1)
|
||||
s->buffer_attr.minreq = (uint32_t) pa_usec_to_bytes_round_up(DEFAULT_PROCESS_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue