From ff7e2946103ce35da702e57e03012c29215017d2 Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Sun, 3 Dec 2017 22:19:16 -0500 Subject: 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. --- player/osd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player/osd.c') 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, -- cgit v1.2.3