summaryrefslogtreecommitdiffstats
path: root/player/osd.c
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2017-12-03 22:19:16 -0500
committerLeo Izen <leo.izen@gmail.com>2017-12-03 22:23:24 -0500
commitff7e2946103ce35da702e57e03012c29215017d2 (patch)
treecb13071a68dbd3609b44d205964a65e7e4386783 /player/osd.c
parenta6ca1677941b817cce401eb4d75f9c049b789b55 (diff)
downloadmpv-ff7e2946103ce35da702e57e03012c29215017d2.tar.bz2
mpv-ff7e2946103ce35da702e57e03012c29215017d2.tar.xz
player: use start timestamp for ab-looping if --ab-loop-a is absent
If --ab-loop-b is present, then ab-looping will be enabled and will attempt to seek to the beginning of the file. This patch changes it so it will instead seek to the start of playback, either via --start or some equivalent, rather than always to the beginning of the file.
Diffstat (limited to 'player/osd.c')
-rw-r--r--player/osd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/player/osd.c b/player/osd.c
index 1453c9b599..127550c29b 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -356,9 +356,10 @@ void set_osd_bar_chapters(struct MPContext *mpctx, int type)
mpctx->osd_progbar.num_stops = 0;
double len = get_time_length(mpctx);
if (len > 0) {
- if (opts->ab_loop[0] != MP_NOPTS_VALUE) {
+ double ab_loop_start_time = get_ab_loop_start_time(mpctx);
+ if (ab_loop_start_time != MP_NOPTS_VALUE) {
MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops,
- mpctx->osd_progbar.num_stops, opts->ab_loop[0] / len);
+ mpctx->osd_progbar.num_stops, ab_loop_start_time / len);
}
if (opts->ab_loop[1] != MP_NOPTS_VALUE) {
MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops,