mirror of
https://github.com/mpv-player/mpv
synced 2025-03-07 22:57:42 +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:
parent
a2133d7684
commit
859e956523
12
mplayer.c
12
mplayer.c
@ -3716,12 +3716,6 @@ if(!mpctx->demuxer)
|
|||||||
mpctx->num_sources = 1;
|
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;
|
mpctx->initialized_flags|=INITIALIZED_DEMUXER;
|
||||||
|
|
||||||
if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) {
|
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);
|
seek(mpctx, seek_to_sec, SEEK_ABSOLUTE);
|
||||||
end_at.pos += seek_to_sec;
|
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) {
|
if (end_at.type == END_AT_SIZE) {
|
||||||
mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Option -endpos in MPlayer does not yet support size units.\n");
|
mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Option -endpos in MPlayer does not yet support size units.\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user