mirror of https://github.com/mpv-player/mpv
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:
parent
6ae85191ac
commit
2d6059c4e5
|
@ -518,7 +518,9 @@ static void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
|
||||||
|
|
||||||
switch(priv->frmt) {
|
switch(priv->frmt) {
|
||||||
case WAV:
|
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"
|
// 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;
|
priv->last_pts -= sh_audio->wf->nAvgBytesPerSec/(float)sh_audio->i_bps;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue