diff --git a/src/uosc/main.lua b/src/uosc/main.lua index c63a8d1b..683f3d08 100644 --- a/src/uosc/main.lua +++ b/src/uosc/main.lua @@ -431,19 +431,21 @@ end function update_human_times() if state.time then - state.time_human = format_time(state.time, state.duration) + local max_seconds = state.duration if state.duration then local speed = state.speed or 1 if options.destination_time == 'playtime-remaining' then - state.destination_time_human = format_time((state.time - state.duration) / speed, state.duration) + max_seconds = speed >= 1 and state.duration or state.duration / speed + state.destination_time_human = format_time((state.time - state.duration) / speed, max_seconds) elseif options.destination_time == 'total' then - state.destination_time_human = format_time(state.duration, state.duration) + state.destination_time_human = format_time(state.duration, max_seconds) else - state.destination_time_human = format_time(state.time - state.duration, state.duration) + state.destination_time_human = format_time(state.time - state.duration, max_seconds) end else state.destination_time_human = nil end + state.time_human = format_time(state.time, max_seconds) else state.time_human = nil end