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

Stan Seibert volsung at xiph.org
Thu Dec 6 20:00:47 PST 2001



volsung     01/12/06 20:00:47

  Modified:    src/plugins/alsa09 ao_alsa09.c
  Log:
  Cleaned up some leftovers from the buffering code.

Revision  Changes    Path
1.7       +1 -16     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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ao_alsa09.c	2001/12/07 03:59:27	1.6
+++ ao_alsa09.c	2001/12/07 04:00:47	1.7
@@ -59,9 +59,7 @@
 typedef struct ao_alsa_internal
 {
         snd_pcm_t *pcm_handle;
-	char *buf;
         int buf_size;
-	int buf_end;
         int sample_size;
         int periods;
         char *dev;
@@ -141,19 +139,10 @@
         int fmt;
         char *cmd;
 
-	internal->buf = malloc(internal->buf_size);
-	internal->buf_end = 0;
-	if (internal->buf == NULL)
-	  return 0;  /* Could not alloc swap buffer */
 
-
         /* Open the ALSA device */
         err = snd_pcm_open(&(internal->pcm_handle), internal->dev,
                            SND_PCM_STREAM_PLAYBACK, 0);
-	if (err < 0) {
-		free (internal->buf);
-		return 0;
-	}
 
         snd_pcm_hw_params_alloca(&hwparams);
 
@@ -225,7 +214,6 @@
 error:
         fprintf(stderr, "ALSA %s error: %s\n", cmd, snd_strerror(err));
         snd_pcm_close(internal->pcm_handle);
-	free(internal->buf);
         return 0;
 }
 
@@ -265,13 +253,10 @@
 int ao_plugin_close(ao_device *device)
 {
         ao_alsa_internal *internal = (ao_alsa_internal *) device->internal;
-	int result;
 
-	/* Clear buffer */
         snd_pcm_close(internal->pcm_handle);
-	free(internal->buf);
 
-	return result;
+	return 1;
 }
 
 

--- >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