Skip to content

Commit

Permalink
Fixup: retain past logic with a correction
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong committed Nov 24, 2017
1 parent 7e140e1 commit 08dab0c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/audio/AudioJack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
#endif

jack_nframes_t done = 0;
while( done < _nframes && m_stopped == false )
bool moreSamples = true;
while( done < _nframes && !m_stopped && moreSamples )
{
jack_nframes_t todo = qMin<jack_nframes_t>(
_nframes,
Expand All @@ -399,11 +400,15 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
if( m_framesDoneInCurBuf == m_framesToDoInCurBuf )
{
m_framesToDoInCurBuf = getNextBuffer( m_outBuf );
if( !m_framesToDoInCurBuf )
{
moreSamples = false;
}
m_framesDoneInCurBuf = 0;
}
}

if( m_stopped == true )
if( m_stopped || !moreSamples )
{
for( int c = 0; c < channels(); ++c )
{
Expand Down

0 comments on commit 08dab0c

Please sign in to comment.