From 1944a34c230b6afb7707fe4fb5eb0c613b96db9b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 21 Apr 2016 22:15:17 +0200 Subject: command: if only ab-loop-b is set, loop from start of file Commit 382bafcb changed the behavior for ab-loop-a. This commit changes ab-loop-b so that the behavior is symmetric. Adjust the OSD rendering accordingly to the two changes. Also fix mentions of the "ab_loop" command to the now preferred "ab-loop". --- player/osd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'player/osd.c') diff --git a/player/osd.c b/player/osd.c index 7da4a038bf..810df73719 100644 --- a/player/osd.c +++ b/player/osd.c @@ -362,14 +362,15 @@ 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 && - opts->ab_loop[1] != MP_NOPTS_VALUE) - { + if (opts->ab_loop[0] != MP_NOPTS_VALUE) { MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, mpctx->osd_progbar.num_stops, opts->ab_loop[0] / len); + } + if (opts->ab_loop[1] != MP_NOPTS_VALUE) { MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, mpctx->osd_progbar.num_stops, opts->ab_loop[1] / len); - } else { + } + if (mpctx->osd_progbar.stops == 0) { int num = get_chapter_count(mpctx); for (int n = 0; n < num; n++) { double time = chapter_start_time(mpctx, n); -- cgit v1.2.3