diff --git a/player/command.c b/player/command.c index 942430f3ba..03ea4d640c 100644 --- a/player/command.c +++ b/player/command.c @@ -1961,9 +1961,10 @@ static int property_switch_track(struct m_property *prop, int action, void *arg, if (!mpctx->playback_initialized) return M_PROPERTY_ERROR; struct m_property_switch_arg *sarg = arg; - mp_switch_track_n(mpctx, order, type, - track_next(mpctx, type, sarg->inc >= 0 ? +1 : -1, track), - FLAG_MARK_SELECTION); + do { + track = track_next(mpctx, type, sarg->inc >= 0 ? +1 : -1, track); + mp_switch_track_n(mpctx, order, type, track, FLAG_MARK_SELECTION); + } while (mpctx->current_track[order][type] != track); print_track_list(mpctx, "Track switched:"); return M_PROPERTY_OK; }