[vlc-commits] ALSA: force small period to avoid latency problems

Rémi Denis-Courmont git at videolan.org
Wed May 30 18:20:44 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 30 19:15:56 2012 +0300| [6abf293779383854aaeb905e8bb19f7c73ba6acf] | committer: 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)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=6abf293779383854aaeb905e8bb19f7c73ba6acf
---

 modules/audio_output/alsa.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index c742721..b1b7b0e 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -443,7 +443,7 @@ static int Open (vlc_object_t *obj)
         msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val));
         goto error;
     }
-#if 1
+#if 0
     val = snd_pcm_hw_params_get_buffer_time (hw, &param, NULL);
     if (val)
     {
@@ -452,7 +452,7 @@ static int Open (vlc_object_t *obj)
     }
     else
         param /= 2;
-#else /* work-around for PulseAudio: */
+#else /* work-around for period-long latency outputs (e.g. PulseAudio): */
     param = AOUT_MIN_PREPARE_TIME;
 #endif
     val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);



More information about the vlc-commits mailing list