[xiph-commits] r17764 - trunk/ao/src/plugins/alsa
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Fri Dec 17 03:32:02 PST 2010
Author: xiphmont
Date: 2010-12-17 03:32:02 -0800 (Fri, 17 Dec 2010)
New Revision: 17764
Modified:
trunk/ao/src/plugins/alsa/ao_alsa.c
Log:
Apply patch from #1762 to more correctly handle latency setup in ALSA.
Modified: trunk/ao/src/plugins/alsa/ao_alsa.c
===================================================================
--- trunk/ao/src/plugins/alsa/ao_alsa.c 2010-12-17 11:28:29 UTC (rev 17763)
+++ trunk/ao/src/plugins/alsa/ao_alsa.c 2010-12-17 11:32:02 UTC (rev 17764)
@@ -274,14 +274,6 @@
"by the hardware, using %u\n", format->rate, rate);
}
- /* set the length of the hardware sample buffer in microseconds */
- err = snd_pcm_hw_params_set_buffer_time_near(internal->pcm_handle,
- params, &(internal->buffer_time), 0);
- if (err < 0){
- adebug("snd_pcm_hw_params_set_buffer_time_near() failed.\n");
- return err;
- }
-
/* calculate a period time of one half sample time */
if ((internal->period_time == 0) && (rate > 0))
internal->period_time =
@@ -295,6 +287,14 @@
return err;
}
+ /* set the length of the hardware sample buffer in microseconds */
+ err = snd_pcm_hw_params_set_buffer_time_near(internal->pcm_handle,
+ params, &(internal->buffer_time), 0);
+ if (err < 0){
+ adebug("snd_pcm_hw_params_set_buffer_time_near() failed.\n");
+ return err;
+ }
+
/* commit the params structure to the hardware via ALSA */
err = snd_pcm_hw_params(internal->pcm_handle, params);
if (err < 0){
More information about the commits
mailing list