changeset 26313:270df0673cc2

reset() should not senselessly close and reopen the device but instead just call flush_audio()
author reimar
date Mon, 07 Apr 2008 17:39:41 +0000
parents 43fe46da690b
children 67dbe3155ce5
files libao2/ao_sun.c
diffstat 1 files changed, 1 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_sun.c	Mon Apr 07 17:32:44 2008 +0000
+++ b/libao2/ao_sun.c	Mon Apr 07 17:39:41 2008 +0000
@@ -588,29 +588,7 @@
 
 // stop playing and empty buffers (for seeking/pause)
 static void reset(void){
-    audio_info_t info;
-
-    uninit(1);
-    audio_fd=open(audio_dev, O_WRONLY);
-    if(audio_fd<0){
-	mp_msg(MSGT_AO, MSGL_FATAL, MSGTR_AO_SUN_CantReopenReset, strerror(errno));
-	return;
-    }
-
-    ioctl(audio_fd, AUDIO_DRAIN, 0);
-
-    AUDIO_INITINFO(&info);
-    info.play.encoding = af2sunfmt(ao_data.format);
-    info.play.precision =
-	(ao_data.format==AF_FORMAT_S16_NE 
-	 ? AUDIO_PRECISION_16
-	 : AUDIO_PRECISION_8);
-    info.play.channels = ao_data.channels;
-    info.play.sample_rate = ao_data.samplerate;
-    info.play.samples = 0;
-    info.play.eof = 0;
-    info.play.error = 0;
-    ioctl (audio_fd, AUDIO_SETINFO, &info);
+    flush_audio(audio_fd);
     queued_bursts = 0;
     queued_samples = 0;
 }