[pulseaudio-discuss] [PATCH] stream: Support extended API with PULSE_LATENCY_MSEC if possible

Arun Raghavan arun at accosted.net
Wed Jun 10 22:54:10 PDT 2015


On 11 June 2015 at 11:23, David Henningsson
<david.henningsson at canonical.com> wrote:
>
>
> On 2015-06-11 07:42, arun at accosted.net wrote:
>>
>> From: Arun Raghavan <git at arunraghavan.net>
>>
>> This only works in the single-format case (i.e. we know the format
>> up-front and we're not negotiating).
>> ---
>>   src/pulse/stream.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> Adequately compile-tested and run this time. :/
>>
>> diff --git a/src/pulse/stream.c b/src/pulse/stream.c
>> index af2a9b3..9ec23eb 100644
>> --- a/src/pulse/stream.c
>> +++ b/src/pulse/stream.c
>> @@ -987,12 +987,20 @@ static void patch_buffer_attr(pa_stream *s,
>> pa_buffer_attr *attr, pa_stream_flag
>>
>>       if ((e = getenv("PULSE_LATENCY_MSEC"))) {
>>           uint32_t ms;
>> +        pa_sample_spec ss;
>> +
>> +        pa_sample_spec_init(&ss);
>> +
>> +        if (pa_sample_spec_valid(&s->sample_spec))
>> +            ss = s->sample_spec;
>> +        else if (s->n_formats == 1)
>> +            pa_format_info_to_sample_spec(s->req_formats[0], &ss, NULL);
>
>
> Looks like we'll still have a bug in case s->n_formats != 1, so we'll still
> need my workaround, right?

Yup, this was meant to apply on top of your patch (modulo the error
message comment I had).

-- Arun


More information about the pulseaudio-discuss mailing list