fix: last line of lyrics is incorrect
This commit is contained in:
parent
4b57dda342
commit
a2b9f94015
|
@ -123,12 +123,12 @@ void LyricsManager::updateCurrentTimeMs(int curTimeMs, int totalTimeMs)
|
||||||
if (!hasLyrics()) return;
|
if (!hasLyrics()) return;
|
||||||
|
|
||||||
// TODO: we don't need to find from the top everytime the time is updated
|
// TODO: we don't need to find from the top everytime the time is updated
|
||||||
auto iter = std::find_if(m_timestampList.begin(), m_timestampList.end() + 1, [&curTimeMs, this](int timestamp) -> bool {
|
auto iter = std::find_if(m_timestampList.begin(), m_timestampList.end(), [&curTimeMs, this](int timestamp) -> bool {
|
||||||
return (timestamp + m_timeOffset) > curTimeMs;
|
return (timestamp + m_timeOffset) > curTimeMs;
|
||||||
});
|
});
|
||||||
|
|
||||||
m_nextLyricsTime = (iter == m_timestampList.end() + 1) ? totalTimeMs : *iter;
|
m_nextLyricsTime = iter == m_timestampList.end() ? totalTimeMs : *iter;
|
||||||
if (iter != m_timestampList.begin() && iter != (m_timestampList.end() + 1)) {
|
if (iter != m_timestampList.begin()) {
|
||||||
iter--;
|
iter--;
|
||||||
}
|
}
|
||||||
m_currentLyricsTime = *iter;
|
m_currentLyricsTime = *iter;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user