From 58f6cf824b2913f699d63f52b1db158008c99b15 Mon Sep 17 00:00:00 2001 From: Stan Seibert <volsung@xiph.org> Date: Fri, 7 Dec 2001 04:00:47 +0000 Subject: [PATCH] Cleaned up some leftovers from the buffering code. git-svn-id: http://svn.xiph.org/trunk/ao@2433 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- src/plugins/alsa09/ao_alsa09.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/plugins/alsa09/ao_alsa09.c b/src/plugins/alsa09/ao_alsa09.c index 3260696..f6650ba 100644 --- a/src/plugins/alsa09/ao_alsa09.c +++ b/src/plugins/alsa09/ao_alsa09.c @@ -59,9 +59,7 @@ static ao_info ao_alsa_info = 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 ao_plugin_open(ao_device *device, ao_sample_format *format) 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 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format) 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_play(ao_device *device, const char *output_samples, 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; } -- GitLab