diff options
author | 2003-01-05 13:48:13 +0000 | |
---|---|---|
committer | 2003-01-05 13:48:13 +0000 | |
commit | 6c4f39360aa180858a8c0433d215927a74a44676 (patch) | |
tree | caa8ce897c72bcfd235045a0715d6ef71058ede3 /libmpdemux/demux_ogg.c | |
parent | 34b70a1c7781ea09ae26a89e52097fc136909280 (diff) |
mosu: Fixed OGG/OGM seeking for XCDs in which the OGG/OGM does not start at pos 0 in the stream
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8796 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r-- | libmpdemux/demux_ogg.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c index 33ebd6d10b..93ee8e4a5b 100644 --- a/libmpdemux/demux_ogg.c +++ b/libmpdemux/demux_ogg.c @@ -725,7 +725,7 @@ int demux_ogg_open(demuxer_t* demuxer) { if(!s->end_pos) demuxer->seekable = 0; else { - demuxer->movi_start = 0; + demuxer->movi_start = s->start_pos; // Needed for XCD (Ogg written in MODE2) demuxer->movi_end = s->end_pos; demuxer->seekable = 1; if(index_mode == 2) @@ -965,19 +965,18 @@ void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { pos = ogg_d->syncpoints[sp].page_pos; } else { - pos = flags & 1 ? demuxer->movi_start : ogg_d->pos; + pos = flags & 1 ? 0 : ogg_d->pos; if(flags & 2) pos += (demuxer->movi_end - demuxer->movi_start) * rel_seek_secs; else pos += rel_seek_secs * ogg_d->pos / (os->lastpos / rate); - - if(pos < demuxer->movi_start) - pos = demuxer->movi_start; - else if(pos > demuxer->movi_end) + if (pos < 0) + pos = 0; + else if (pos > (demuxer->movi_end - demuxer->movi_start)) return; } - stream_seek(demuxer->stream,pos); + stream_seek(demuxer->stream,pos+demuxer->movi_start); ogg_sync_reset(sync); for(i = 0 ; i < ogg_d->num_sub ; i++) { ogg_stream_reset(&ogg_d->subs[i].stream); |