corrects an off-by-one error when trying to seek beyond the end of file.

patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7003 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-08-14 21:25:01 +00:00
parent 09cbf2a378
commit 99d4526691
1 changed files with 1 additions and 1 deletions

View File

@ -594,7 +594,7 @@ void demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags){
// find nearest video keyframe chunk pos:
if(rel_seek_frames>0){
// seek forward
while(video_chunk_pos<priv->idx_size){
while(video_chunk_pos<priv->idx_size-1){
int id=((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].ckid;
if(avi_stream_id(id)==d_video->id){ // video frame
if((--rel_seek_frames)<0 && ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;