1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

Bug1627: Fix infinite recursion of error dialogs, failing start scrub

This commit is contained in:
Paul Licameli 2017-07-21 01:39:13 -04:00
parent d1f7e7e46f
commit 57e040070c
2 changed files with 15 additions and 0 deletions

View File

@ -709,10 +709,17 @@ int ControlToolBar::PlayPlayRegion(const SelectedRegion &selectedRegion,
#endif
}
else {
// Bug1627 (part of it):
// infinite error spew when trying to start scrub:
// Problem was that the error dialog yields to events,
// causing recursion to this function in the scrub timer
// handler! Easy fix, just delay the user alert instead.
CallAfter( [=]{
// Show error message if stream could not be opened
ShowErrorDialog(this, _("Error"),
_("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
wxT("http://manual.audacityteam.org/man/faq_errors.html#sound_device"), false);
});
}
}

View File

@ -421,6 +421,14 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
mPoller->Start(ScrubPollInterval_ms);
}
else if (mScrubToken <= 0) {
// Bug1627 (part of it):
// infinite error spew when trying to start scrub:
// If failed for reasons of audio device problems, do not try
// again with repeated timer ticks.
mScrubStartPosition = -1;
return false;
}
// Return true whether we started scrub, or are still waiting to decide.
return true;