shithub: sox

Download patch

ref: 4aff61afd036ee771789f1d52647810beefee56e
parent: c4823e9b47c37ee8e8967daea27001f48d14d571
author: cbagwell <cbagwell>
date: Sun Oct 24 17:18:08 EDT 2004

last partial buffer wasn't being flushed correctly on writes.

--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,8 @@
   o Update to ALSA driver to do a better job of detecting
     unsupported sample rate/size/encoding and change to
     a supported one.
+  o Fix bug in alsa writing were last last partial buffer
+    wasn't being flushed.
   o Guentcho Skordev pointed out ogg vorbis files were using
     the same value for serial numbers each time.
 
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -315,8 +315,11 @@
 int st_alsastopwrite(ft)
 ft_t ft;
 {
+    int rc;
+
+    rc = st_rawstopwrite(ft);
     ioctl(fileno(ft->fp), SNDRV_PCM_IOCTL_DRAIN);
-    return(st_rawstopwrite(ft));
+    return(rc);
 }
 
 #else /* ! HAVE_ALSA9 */