comparison libmpdemux/demux_audio.c @ 5796:7a4b18b787c0

Fix % seeking
author albeu
date Tue, 23 Apr 2002 13:27:46 +0000
parents 9579496a91db
children f9d23c2aa6b7
comparison
equal deleted inserted replaced
5795:6ee426749843 5796:7a4b18b787c0
286 sh_audio->timer = priv->last_pts - (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; 286 sh_audio->timer = priv->last_pts - (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
287 resync_audio_stream(sh_audio); 287 resync_audio_stream(sh_audio);
288 return; 288 return;
289 } 289 }
290 290
291 base = flags&1 ? demuxer->movi_start : stream_tell(s) ; 291 base = flags&1 ? demuxer->movi_start : stream_tell(s);
292 len = (demuxer->movi_end && flags&2) ? (demuxer->movi_end - demuxer->movi_start)*rel_seek_secs : rel_seek_secs; 292 if(flags&2)
293 293 pos = base + ((demuxer->movi_end - demuxer->movi_start)*rel_seek_secs);
294 pos = base+(len*sh_audio->i_bps); 294 else
295 pos = base + (rel_seek_secs*sh_audio->i_bps);
295 296
296 if(demuxer->movi_end && pos >= demuxer->movi_end) { 297 if(demuxer->movi_end && pos >= demuxer->movi_end) {
297 sh_audio->timer = (stream_tell(s) - demuxer->movi_start)/(float)sh_audio->i_bps; 298 sh_audio->timer = (stream_tell(s) - demuxer->movi_start)/(float)sh_audio->i_bps;
298 return; 299 return;
299 } else if(pos < demuxer->movi_start) 300 } else if(pos < demuxer->movi_start)