[vlc-devel] [PATCH] aout: pulse: use jitter delay

Thomas Guillem thomas at gllm.fr
Tue Feb 5 14:04:07 CET 2019


Yes, it's better to use the period as an IN/OUT parameter and let the core calculate the jitter from it. 

On Tue, Feb 5, 2019, at 12:29, Rémi Denis-Courmont wrote:
> This seems to use the jitter as a input/output parameter, but the Doxygen says it's output.
> 
> And adjusting the period according to jitter is very confused, since jitter is a statistic that gets computed during playback while period is a predetermined value.
> 
> Le 5 février 2019 12:46:23 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>>  modules/audio_output/pulse.c | 9 +++++----
>>  1 file changed, 5 insertions(+), 4 deletions(-)
>> 
>> diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
>> index 8be4004534..9a24d0f9f9 100644
>> --- a/modules/audio_output/pulse.c
>> +++ b/modules/audio_output/pulse.c
>> @@ -785,14 +785,17 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt,
>>                              | PA_STREAM_AUTO_TIMING_UPDATE
>>                              | PA_STREAM_FIX_RATE;
>>  
>> +    vlc_tick_t period = *jitter / 2;
>> +    assert(period >= AOUT_MAX_PTS_ADVANCE);
>> +
>>      struct pa_buffer_attr attr;
>>      attr.maxlength = -1;
>>      /* PulseAudio goes berserk if the target length (tlength) is not
>>       * significantly longer than 2 periods (minreq), or when the period length
>>       * is unspecified and the target length is short. */
>> -    attr.tlength = pa_usec_to_bytes(3 * AOUT_MIN_PREPARE_TIME, &ss);
>> +    attr.tlength = pa_usec_to_bytes(3 * period, &ss);
>>      attr.prebuf = 0; /* trigger manually */
>> -    attr.minreq = pa_usec_to_bytes(AOUT_MIN_PREPARE_TIME, &ss);
>> +    attr.minreq = pa_usec_to_bytes(period, &ss);
>>      attr.fragsize = 0; /* not used for output */
>>  
>>      pa_cvolume *cvolume = NULL, cvolumebuf;
>> @@ -819,7 +822,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt,
>>          /* Setup low latency in order to quickly react to ambisonics
>>           * filters viewpoint changes. */
>>          flags |= PA_STREAM_ADJUST_LATENCY;
>> -        attr.tlength = pa_usec_to_bytes(3 * AOUT_MIN_PREPARE_TIME, &ss);
>>      }
>>  
>>      if (encoding != PA_ENCODING_PCM)
>> @@ -963,7 +965,6 @@ fail:
>>      pa_threaded_mainloop_unlock(sys->mainloop);
>>      Stop(aout);
>>      return VLC_EGENERIC;
>> -    VLC_UNUSED(jitter);
>>  }
>>  
>>  /**
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190205/acb54d2f/attachment.html>


More information about the vlc-devel mailing list