1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00

Fix -chapter with ordered chapters

Move the code doing an initial seek specified by -chapter to a
position where it works if ordered chapters are used.
This commit is contained in:
Uoti Urpala 2010-04-24 20:21:48 +03:00
parent a2133d7684
commit 859e956523

View File

@ -3716,12 +3716,6 @@ if(!mpctx->demuxer)
mpctx->num_sources = 1;
}
if(opts->chapterrange[0]>1) {
double pts;
if (seek_chapter(mpctx, opts->chapterrange[0]-1, &pts, NULL) >= 0 && pts > -1.0)
seek(mpctx, pts, SEEK_ABSOLUTE);
}
mpctx->initialized_flags|=INITIALIZED_DEMUXER;
if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) {
@ -4064,6 +4058,12 @@ if (seek_to_sec || mpctx->timeline) {
seek(mpctx, seek_to_sec, SEEK_ABSOLUTE);
end_at.pos += seek_to_sec;
}
if (opts->chapterrange[0] > 1) {
double pts;
if (seek_chapter(mpctx, opts->chapterrange[0]-1, &pts, NULL) >= 0
&& pts > -1.0)
seek(mpctx, pts, SEEK_ABSOLUTE);
}
if (end_at.type == END_AT_SIZE) {
mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Option -endpos in MPlayer does not yet support size units.\n");