1
mirror of https://github.com/mpv-player/mpv synced 2025-01-24 19:37:30 +01:00

when seeking consider stream->start_pos instead of 0 as initial position; patch by Zuxy Meng approved by Michael

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22458 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2007-03-04 16:23:18 +00:00
parent 10bb905591
commit b14bee2928

View File

@ -134,7 +134,9 @@ static offset_t mp_seek(URLContext *h, offset_t pos, int whence){
pos +=stream_tell(stream);
else if(whence == SEEK_END)
pos += stream->end_pos;
else if(whence != SEEK_SET)
else if(whence == SEEK_SET)
pos += stream->start_pos;
else
return -1;
if(pos<stream->end_pos && stream->eof)
@ -142,7 +144,7 @@ static offset_t mp_seek(URLContext *h, offset_t pos, int whence){
if(stream_seek(stream, pos)==0)
return -1;
return pos;
return pos - stream->start_pos;
}
static int mp_close(URLContext *h){