Commit 6abf2937 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

ALSA: force small period to avoid latency problems

This is as already done a long time ago for PulseAudio. VLC might
deliver audio a long time ahead, but there is no warranty thereof.
So a small latency must be assumed for the worst case.
(cherry picked from commit 894b9dfb3b1d3d5852cb0d52470d73c06be27b37)
parent 13f28a4e
...@@ -443,7 +443,7 @@ static int Open (vlc_object_t *obj) ...@@ -443,7 +443,7 @@ static int Open (vlc_object_t *obj)
msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val)); msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val));
goto error; goto error;
} }
#if 1 #if 0
val = snd_pcm_hw_params_get_buffer_time (hw, &param, NULL); val = snd_pcm_hw_params_get_buffer_time (hw, &param, NULL);
if (val) if (val)
{ {
...@@ -452,7 +452,7 @@ static int Open (vlc_object_t *obj) ...@@ -452,7 +452,7 @@ static int Open (vlc_object_t *obj)
} }
else else
param /= 2; param /= 2;
#else /* work-around for PulseAudio: */ #else /* work-around for period-long latency outputs (e.g. PulseAudio): */
param = AOUT_MIN_PREPARE_TIME; param = AOUT_MIN_PREPARE_TIME;
#endif #endif
val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL); val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment