Mercurial > mplayer.hg
changeset 22440:ee6b8e74d727
when seeking consider stream->start_pos instead of 0 as initial position; patch by Zuxy Meng approved by Michael
author | nicodvb |
---|---|
date | Sun, 04 Mar 2007 16:23:18 +0000 |
parents | 56518bb5e79c |
children | 6f183c95aafc |
files | libmpdemux/demux_lavf.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c Sun Mar 04 15:48:20 2007 +0000 +++ b/libmpdemux/demux_lavf.c Sun Mar 04 16:23:18 2007 +0000 @@ -134,7 +134,9 @@ 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 @@ if(stream_seek(stream, pos)==0) return -1; - return pos; + return pos - stream->start_pos; } static int mp_close(URLContext *h){