diff options
author | wm4 <wm4@nowhere> | 2014-09-25 20:42:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-25 21:32:56 +0200 |
commit | 07668e50de8c3d9418f7eb1ef00f0391b29a05da (patch) | |
tree | 765064185ab57b5aa046c3c9678abd1167fcc93c /player | |
parent | d23ffd243f33ce5d6a5649c7909664b0ae1e858e (diff) | |
download | mpv-07668e50de8c3d9418f7eb1ef00f0391b29a05da.tar.bz2 mpv-07668e50de8c3d9418f7eb1ef00f0391b29a05da.tar.xz |
player: move code to make playloop smaller
This is basically a cosmetic change, although it weirdly also affects
the percent position in encoding mode.
Diffstat (limited to 'player')
-rw-r--r-- | player/misc.c | 12 | ||||
-rw-r--r-- | player/playloop.c | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/player/misc.c b/player/misc.c index 51f3e0f863..d5e27f9584 100644 --- a/player/misc.c +++ b/player/misc.c @@ -80,8 +80,9 @@ double rel_time_to_abs(struct MPContext *mpctx, struct m_rel_time t) double get_play_end_pts(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; + double end = MP_NOPTS_VALUE; if (opts->play_end.type) { - return rel_time_to_abs(mpctx, opts->play_end); + end = rel_time_to_abs(mpctx, opts->play_end); } else if (opts->play_length.type) { double startpts = get_start_time(mpctx); double start = rel_time_to_abs(mpctx, opts->play_start); @@ -89,9 +90,14 @@ double get_play_end_pts(struct MPContext *mpctx) start = startpts; double length = rel_time_to_abs(mpctx, opts->play_length); if (start != MP_NOPTS_VALUE && length != MP_NOPTS_VALUE) - return start + length; + end = start + length; } - return MP_NOPTS_VALUE; + if (opts->chapterrange[1] > 0) { + double cend = chapter_start_time(mpctx, opts->chapterrange[1]); + if (cend != MP_NOPTS_VALUE && (end == MP_NOPTS_VALUE || cend < end)) + end = cend; + } + return end; } // Time used to seek external tracks to. diff --git a/player/playloop.c b/player/playloop.c index c9eba1b9c2..de1165e963 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -859,12 +859,6 @@ void run_playloop(struct MPContext *mpctx) } } - if (opts->chapterrange[1] > 0) { - double end = chapter_start_time(mpctx, opts->chapterrange[1]); - if (end != MP_NOPTS_VALUE && (endpts == MP_NOPTS_VALUE || end < endpts)) - endpts = end; - } - handle_cursor_autohide(mpctx); handle_heartbeat_cmd(mpctx); |