diff options
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/playloop.c b/player/playloop.c index 6121c7367c..bbcc9a3df7 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -947,9 +947,9 @@ void run_playloop(struct MPContext *mpctx) } if (opts->chapterrange[1] > 0) { - int cur_chapter = get_current_chapter(mpctx); - if (cur_chapter != -1 && cur_chapter + 1 > opts->chapterrange[1]) - mpctx->stop_play = PT_NEXT_ENTRY; + double end = chapter_start_time(mpctx, opts->chapterrange[1]); + if (end != MP_NOPTS_VALUE && (endpts == MP_NOPTS_VALUE || end < endpts)) + endpts = end; } if (mpctx->d_audio && !mpctx->restart_playback && !ao_untimed(mpctx->ao)) { |