diff options
Diffstat (limited to 'player/osd.c')
-rw-r--r-- | player/osd.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/player/osd.c b/player/osd.c index 7e099e2d0c..b6a0c1b98d 100644 --- a/player/osd.c +++ b/player/osd.c @@ -333,19 +333,29 @@ static void update_osd_bar(struct MPContext *mpctx, int type, static void set_osd_bar_chapters(struct MPContext *mpctx, int type) { + struct MPOpts *opts = mpctx->opts; if (mpctx->osd_progbar.type != type) return; mpctx->osd_progbar.num_stops = 0; double len = get_time_length(mpctx); if (len > 0) { - int num = get_chapter_count(mpctx); - for (int n = 0; n < num; n++) { - double time = chapter_start_time(mpctx, n); - if (time >= 0) { - float pos = time / len; - MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, - mpctx->osd_progbar.num_stops, pos); + if (opts->ab_loop[0] != MP_NOPTS_VALUE && + opts->ab_loop[1] != MP_NOPTS_VALUE) + { + MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, + mpctx->osd_progbar.num_stops, opts->ab_loop[0] / len); + MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, + mpctx->osd_progbar.num_stops, opts->ab_loop[1] / len); + } else { + int num = get_chapter_count(mpctx); + for (int n = 0; n < num; n++) { + double time = chapter_start_time(mpctx, n); + if (time >= 0) { + float pos = time / len; + MP_TARRAY_APPEND(mpctx, mpctx->osd_progbar.stops, + mpctx->osd_progbar.num_stops, pos); + } } } } |