diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-04 16:23:18 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-04 16:23:18 +0000 |
commit | b14bee292837f8da4241ff29ecc3c454c948c0df (patch) | |
tree | 71cd115cb47c8665d5eec5d0f5e911c06746b53e /libmpdemux | |
parent | 10bb9055912df863a6fb12996d8c0a18a83bb8ba (diff) | |
download | mpv-b14bee292837f8da4241ff29ecc3c454c948c0df.tar.bz2 mpv-b14bee292837f8da4241ff29ecc3c454c948c0df.tar.xz |
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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_lavf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 12906d56de..bb45cc9d36 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -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){ |