mirror of https://github.com/mpv-player/mpv
We can support SEEK_END seeks only when stream->end_pos is known
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24105 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
08dd16470b
commit
80ef41dccf
|
@ -141,7 +141,7 @@ static offset_t mp_seek(URLContext *h, offset_t pos, int whence){
|
||||||
mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %d, %d)\n", h, (int)pos, whence);
|
mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %d, %d)\n", h, (int)pos, whence);
|
||||||
if(whence == SEEK_CUR)
|
if(whence == SEEK_CUR)
|
||||||
pos +=stream_tell(stream);
|
pos +=stream_tell(stream);
|
||||||
else if(whence == SEEK_END)
|
else if(whence == SEEK_END && stream->end_pos > 0)
|
||||||
pos += stream->end_pos;
|
pos += stream->end_pos;
|
||||||
else if(whence == SEEK_SET)
|
else if(whence == SEEK_SET)
|
||||||
pos += stream->start_pos;
|
pos += stream->start_pos;
|
||||||
|
|
Loading…
Reference in New Issue