Skip to content

Commit

Permalink
MythMusic: Fix rewinds under 00:05 by stopping at 00:01
Browse files Browse the repository at this point in the history
  • Loading branch information
twitham1 authored and linuxdude42 committed Aug 18, 2023
1 parent 4572b9b commit 134cff1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mythplugins/mythmusic/mythmusic/musiccommon.cpp
Expand Up @@ -1100,8 +1100,13 @@ void MusicCommon::seekforward()

void MusicCommon::seekback()
{
// I don't know why, but seeking before 00:05 fails. Repeated
// rewind under 00:05 can hold time < 5s while the music plays.
// Time starts incrementing from zero but is now several seconds
// behind. Finishing a track after this records a truncated
// length. We can workaround this by limiting rewind to 1s.
std::chrono::seconds nextTime = m_currentTime - 5s;
nextTime = std::clamp(nextTime, 0s, m_maxTime);
nextTime = std::clamp(nextTime, 1s, m_maxTime); // #787
seek(nextTime);
}

Expand Down

0 comments on commit 134cff1

Please sign in to comment.