Fix seeking in wav files: align relative to start of data, not start of file

and use nBlockAlign if available.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16819 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-10-20 15:15:53 +00:00
parent 6ae85191ac
commit 2d6059c4e5
1 changed files with 3 additions and 1 deletions

View File

@ -518,7 +518,9 @@ static void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
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;