From 859e956523ceb05790fcdc772544d885c64e863c Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 24 Apr 2010 20:21:48 +0300 Subject: 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. --- mplayer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 0432670a99..f5544b8e57 100644 --- a/mplayer.c +++ b/mplayer.c @@ -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"); -- cgit v1.2.3