# HG changeset patch # User reimar # Date 1207589981 0 # Node ID 270df0673cc2397afbd05df77d49e6ee2bd4dec5 # Parent 43fe46da690ba935df49d5db3bb911ee87ce2eae reset() should not senselessly close and reopen the device but instead just call flush_audio() diff -r 43fe46da690b -r 270df0673cc2 libao2/ao_sun.c --- 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; }