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

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


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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=894b9dfb3b1d3d5852cb0d52470d73c06be27b37
---

 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 6fc4ad7..206b24b 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -445,7 +445,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)
     {
@@ -454,7 +454,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