1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-20 06:10:06 +02:00

Bug 1690: Playback does not stop at the end of MIDI playback

This was caused by the indicator-passed-selection check being inside a loop over all wave tracks.  If there are no wave tracks, then the check never happened.  I added a duplicate version of the check if there are no wave tracks.  This may not be the best solution, but it works for now.

I'm not entirely sure why the check is in the loop (or what's going on with the len and maxLen variables); as such, I just haven't touched that.  Perhaps it would be safe to move the check always outside of the loop, but I'm not completely confident in that.
This commit is contained in:
Pokechu22 2017-07-16 17:02:37 -07:00 committed by Paul Licameli
parent 4d3d32ca4d
commit 03f9592f58

View File

@ -4573,6 +4573,19 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
chanCnt = 0;
}
// Poke: If there are no playback tracks, then the earlier check
// about the time indicator being passed the end won't happen;
// do it here instead (but not if looping or scrubbing)
if (numPlaybackTracks == 0
&& gAudioIO->mPlayMode == AudioIO::PLAY_STRAIGHT)
{
if ((gAudioIO->ReversedTime()
? gAudioIO->mTime <= gAudioIO->mT1
: gAudioIO->mTime >= gAudioIO->mT1)) {
callbackReturn = paComplete;
}
}
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
// Update the current time position, for scrubbing