[pulseaudio-discuss] [PATCH] stream: Check sample spec validity before abiding PULSE_LATENCY_MSEC

Arun Raghavan arun at accosted.net
Fri Jun 12 00:10:34 PDT 2015


On 12 June 2015 at 12:31, David Henningsson
<david.henningsson at canonical.com> wrote:
>
>
> On 2015-06-11 07:33, Arun Raghavan wrote:
>>
>> On 10 June 2015 at 20:59, David Henningsson
>> <david.henningsson at canonical.com> wrote:
>>>
>>> In case the sample spec is not known, as can be the case when
>>> pa_stream_new_extended is used, we cannot satisfy the PULSE_LATENCY_MSEC
>>> request.
>>>
>>> As a workaround disable being able to use PULSE_LATENCY_MSEC in this
>>> case.
>>>
>>> Reported-by: Fritsch <fritsch at xbmc.org>
>>> Signed-off-by: David Henningsson <david.henningsson at canonical.com>
>>> ---
>>>   src/pulse/stream.c | 8 +++++---
>>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/pulse/stream.c b/src/pulse/stream.c
>>> index d4ad505..c301b8e 100644
>>> --- a/src/pulse/stream.c
>>> +++ b/src/pulse/stream.c
>>> @@ -990,16 +990,18 @@ static void patch_buffer_attr(pa_stream *s,
>>> pa_buffer_attr *attr, pa_stream_flag
>>>
>>>           if (pa_atou(e, &ms) < 0 || ms <= 0)
>>>               pa_log_debug("Failed to parse $PULSE_LATENCY_MSEC: %s", e);
>>> +        else if (!pa_sample_spec_valid(&s->sample_spec))
>>> +            pa_log_debug("Ignoring $PULSE_LATENCY_MSEC: %s (invalid
>>> sample spec)", e);
>>
>>
>> Other than that error message needing fixing ("e" is not valid in the
>> else if clause), this looks fine.
>
>
> e should be a valid string, as retrieved earlier from getenv(). pa_atou
> takes a "const char*", so it should not modify e. Am I missing something?

Erf, I misread the context. I'll push your patch out along with mine.

-- Arun


More information about the pulseaudio-discuss mailing list