[MPlayer-dev-eng] [PATCH 10/12] ao_alsa: remove superfluous functions

Clemens Ladisch cl at cl.domainfactory-kunde.de
Mon Feb 6 09:29:16 CET 2006


Remove a call to snd_pcm_prepare() because snd_pcm_hw_params() does it
automatically, and remove a call to snd_pcm_drop() because
snd_pcm_close() does it automatically.

Index: MPlayer-1.0pre7try2/libao2/ao_alsa.c
===================================================================
--- MPlayer-1.0pre7try2.orig/libao2/ao_alsa.c	2006-02-05 22:52:16.000000000 +0100
+++ MPlayer-1.0pre7try2/libao2/ao_alsa.c	2006-02-05 22:52:17.000000000 +0100
@@ -648,11 +648,6 @@ static int init(int rate_hz, int channel
       }
       /* end setting sw-params */
 
-      if ((err = snd_pcm_prepare(alsa_handler)) < 0)
-	{
-	  mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: pcm prepare error: %s\n", snd_strerror(err));
-	}
-
       mp_msg(MSGT_AO,MSGL_INFO,"alsa: %d Hz/%d channels/%d bpf/%d bytes buffer/%s\n",
 	     ao_data.samplerate, ao_data.channels, bytes_per_sample, ao_data.buffersize,
 	     snd_pcm_format_description(alsa_format));
@@ -673,12 +668,6 @@ static void uninit(int immed)
     if (!immed)
       snd_pcm_drain(alsa_handler);
 
-    if ((err = snd_pcm_drop(alsa_handler)) < 0)
-      {
-	mp_msg(MSGT_AO,MSGL_ERR,"alsa-uninit: pcm drop error: %s\n", snd_strerror(err));
-	return;
-      }
-
     if ((err = snd_pcm_close(alsa_handler)) < 0)
       {
 	mp_msg(MSGT_AO,MSGL_ERR,"alsa-uninit: pcm close error: %s\n", snd_strerror(err));




More information about the MPlayer-dev-eng mailing list