changeset 17554:7084d2fbfea4

read data in nBlockAlign aligned chunks
author reimar
date Tue, 07 Feb 2006 22:12:34 +0000
parents 67c30d47ffd4
children b56c246ca8c0
files libmpdemux/demux_audio.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Tue Feb 07 20:22:44 2006 +0000
+++ b/libmpdemux/demux_audio.c	Tue Feb 07 22:12:34 2006 +0000
@@ -428,7 +428,10 @@
       }
     } break;
   case WAV : {
+    unsigned align = sh_audio->wf->nBlockAlign;
     l = sh_audio->wf->nAvgBytesPerSec;
+    if (align)
+      l = (l + align - 1) / align * align;
     dp = new_demux_packet(l);
     l = stream_read(s,dp->buffer,l);
     priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + l/(float)sh_audio->i_bps;