Commit 894b9dfb 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.
parent de7ab066
...@@ -445,7 +445,7 @@ static int Open (vlc_object_t *obj) ...@@ -445,7 +445,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)
{ {
...@@ -454,7 +454,7 @@ static int Open (vlc_object_t *obj) ...@@ -454,7 +454,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