Skip to content

Commit

Permalink
fix startXFadeIfNeeded for loops across buf bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
elgiano committed Apr 26, 2022
1 parent 3e25f72 commit e43de7a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions plugins/XPlayBuf/XPlayBuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,17 @@ void XPlayBuf::startXFade() {

void XPlayBuf::startXFadeIfNeeded(int32 iphase) {
if (!m_isLooping) return;
bool posNeedsToStartFade = m_playbackRate > 0 ?
iphase >= m_currLoop.fadeoutFrame :
iphase <= m_currLoop.rFadeoutFrame;
bool posNeedsToStartFade;

if(m_currLoop.isEndGTStart) {
posNeedsToStartFade = m_playbackRate > 0 ?
iphase >= m_currLoop.fadeoutFrame :
iphase <= m_currLoop.rFadeoutFrame;
} else {
posNeedsToStartFade = m_playbackRate > 0 ?
iphase >= m_currLoop.fadeoutFrame && iphase < m_currLoop.end :
iphase <= m_currLoop.rFadeoutFrame && iphase > m_currLoop.start;
}
if (posNeedsToStartFade) startXFade();
}

Expand Down

0 comments on commit e43de7a

Please sign in to comment.