[vlc-devel] [PATCH 2/3] coreaudio: don't apply dev latency two times
Thomas Guillem
thomas at gllm.fr
Mon Jul 15 17:36:38 CEST 2019
OK, the i_dev_latency_us addition is needed for iOS but not for macOS.
That is why I implemented it in the first place then...
On Mon, Jul 15, 2019, at 17:21, Thomas Guillem wrote:
> It is already handled by the render callback
> ---
> modules/audio_output/coreaudio_common.c | 11 +----------
> modules/audio_output/coreaudio_common.h | 2 --
> 2 files changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/modules/audio_output/coreaudio_common.c
> b/modules/audio_output/coreaudio_common.c
> index 267b395e3a..df468aa736 100644
> --- a/modules/audio_output/coreaudio_common.c
> +++ b/modules/audio_output/coreaudio_common.c
> @@ -224,7 +224,7 @@ ca_TimeGet(audio_output_t *p_aout, vlc_tick_t
> *delay)
>
> const int64_t i_out_frames = BytesToFrames(p_sys, p_sys->i_out_size);
> *delay = FramesToUs(p_sys, i_out_frames + p_sys->i_render_frames)
> - + p_sys->i_dev_latency_us + i_render_delay;
> + + i_render_delay;
>
> lock_unlock(p_sys);
> return 0;
> @@ -357,15 +357,6 @@ ca_Initialize(audio_output_t *p_aout, const
> audio_sample_format_t *fmt,
> msg_Dbg(p_aout, "Current device has a latency of %lld us",
> i_dev_latency_us);
>
> - /* TODO VLC can't handle latency higher than 1 seconds */
> - if (i_dev_latency_us > 1000000)
> - {
> - i_dev_latency_us = 1000000;
> - msg_Warn(p_aout, "VLC can't handle this device latency,
> lowering it to "
> - "%lld", i_dev_latency_us);
> - }
> - p_sys->i_dev_latency_us = i_dev_latency_us;
> -
> /* setup circular buffer */
> size_t i_audiobuffer_size = fmt->i_rate * fmt->i_bytes_per_frame
> / p_sys->i_frame_length;
> diff --git a/modules/audio_output/coreaudio_common.h
> b/modules/audio_output/coreaudio_common.h
> index a860a9aa51..86eb4caec7 100644
> --- a/modules/audio_output/coreaudio_common.h
> +++ b/modules/audio_output/coreaudio_common.h
> @@ -76,8 +76,6 @@ struct aout_sys_common
> unsigned int i_frame_length;
> uint8_t chans_to_reorder;
> uint8_t chan_table[AOUT_CHAN_MAX];
> - /* ca_TimeGet extra latency, in micro-seconds */
> - vlc_tick_t i_dev_latency_us;
> };
>
> void ca_Open(audio_output_t *p_aout);
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list