[xiph-cvs] cvs commit: ao/src/plugins/alsa09 ao_alsa09.c

Warren Dukes shank at xiph.org
Sat Apr 17 05:29:39 PDT 2004



shank       04/04/17 08:29:39

  Modified:    src/plugins/alsa09 ao_alsa09.c
  Log:
  remove changes in last revision since i don't know wtf i'm doing

Revision  Changes    Path
1.22      +14 -13    ao/src/plugins/alsa09/ao_alsa09.c

Index: ao_alsa09.c
===================================================================
RCS file: /usr/local/cvsroot/ao/src/plugins/alsa09/ao_alsa09.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- a/ao_alsa09.c	17 Apr 2004 03:52:48 -0000	1.21
+++ b/ao_alsa09.c	17 Apr 2004 12:29:35 -0000	1.22
@@ -42,12 +42,13 @@
 /* default 500 millisecond buffer */
 #define AO_ALSA_BUFFER_TIME 500000
 
-/* default 50 millisecond period size */
-#define AO_ALSA_PERIOD_TIME 50000
+/* the period time is calculated if not given as an option
+ * note, playback starts after four of these are in the buffer */
+#define AO_ALSA_PERIOD_TIME 0
 
 /* number of samples between interrupts
- * supplying a period_time to ao overrides the use of this  
-#define AO_ALSA_SAMPLE_XFER 256*/
+ * supplying a period_time to ao overrides the use of this  */
+#define AO_ALSA_SAMPLE_XFER 256
 
 /* set mmap to default if enabled at compile time, otherwise, mmap isn't
    the default */
@@ -274,9 +275,9 @@
         /*internal->buffer_time = err;*/
 
         /* calculate a period time of one half sample time */
-	/*if ((internal->period_time == 0) && (rate > 0))
+	if ((internal->period_time == 0) && (rate > 0))
                 internal->period_time =
-			1000000 * AO_ALSA_SAMPLE_XFER / rate;*/
+			1000000 * AO_ALSA_SAMPLE_XFER / rate;
 
         /* set the time per hardware sample transfer */
         internal->cmd = "snd_pcm_hw_params_set_period_time_near";
@@ -329,24 +330,24 @@
            deadlock for dmix in a pol().  So here we just set it to 0,
            I'm not sure why we need to set a threshold > 0 anyway, maybe 
            someone could enlighten me. - shank */
-	/*internal->cmd = "snd_pcm_sw_params_set_start_threshold";
+	internal->cmd = "snd_pcm_sw_params_set_start_threshold";
         err = snd_pcm_sw_params_set_start_threshold(internal->pcm_handle,
-			params, 0);
+			params, /*internal->period_size << 2*/0);
         if (err < 0)
-		return err;*/
+		return err;
 
         /* require a minimum of one full transfer in the buffer */
-	/*internal->cmd = "snd_pcm_sw_params_set_avail_min";
+	internal->cmd = "snd_pcm_sw_params_set_avail_min";
         err = snd_pcm_sw_params_set_avail_min(internal->pcm_handle, params,
                         internal->period_size);
         if (err < 0)
-		return err;*/
+		return err;
 
         /* do not align transfers */
-	/*internal->cmd = "snd_pcm_sw_params_set_xfer_align";
+	internal->cmd = "snd_pcm_sw_params_set_xfer_align";
         err = snd_pcm_sw_params_set_xfer_align(internal->pcm_handle, params, 1);
         if (err < 0)
-		return err;*/
+		return err;
 
         /* commit the params structure to ALSA */
         internal->cmd = "snd_pcm_sw_params";

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list