changeset 16818:67ce689b5764

Fix seeking in wav files: align relative to start of data, not start of file and use nBlockAlign if available.
author reimar
date Thu, 20 Oct 2005 15:15:53 +0000
parents 804bf2acdad2
children 9545bda5e951
files libmpdemux/demux_audio.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Thu Oct 20 13:46:29 2005 +0000
+++ b/libmpdemux/demux_audio.c	Thu Oct 20 15:15:53 2005 +0000
@@ -518,7 +518,9 @@
   
   switch(priv->frmt) {
   case WAV:
-    pos -= (pos % (sh_audio->channels * sh_audio->samplesize) );
+    pos -= (pos - demuxer->movi_start) %
+            (sh_audio->wf->nBlockAlign ? sh_audio->wf->nBlockAlign :
+             (sh_audio->channels * sh_audio->samplesize));
     // We need to decrease the pts by one step to make it the "last one"
     priv->last_pts -= sh_audio->wf->nAvgBytesPerSec/(float)sh_audio->i_bps;
     break;