[pulseaudio-discuss] [PATCH v3 1/3] protocol-native: Ensure tlength is not set higher than maxlength

Tanu Kaskinen tanuk at iki.fi
Mon Mar 25 06:45:50 PDT 2013


On Mon, 2013-03-25 at 09:20 +0100, David Henningsson wrote:
> 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 at canonical.com>
> ---
>  src/pulsecore/protocol-native.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
> index 00c56a6..bafe052 100644
> --- a/src/pulsecore/protocol-native.c
> +++ b/src/pulsecore/protocol-native.c
> @@ -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);

Thanks, I pushed all three patches.

-- 
Tanu



More information about the pulseaudio-discuss mailing list