mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Fixed another small race condition in transport where changing tracks
right when the transport is automatically switching over to the preloaded next track could cause a crash.
This commit is contained in:
parent
3968e39f7f
commit
73305d420d
@ -245,10 +245,18 @@ void Transport::RemoveActive(Player* player) {
|
||||
void Transport::OnPlaybackFinished(Player* player) {
|
||||
this->RaiseStreamEvent(Transport::StreamFinished, player);
|
||||
|
||||
if (this->nextPlayer) {
|
||||
this->StartWithPlayer(this->nextPlayer);
|
||||
bool startedNext = false;
|
||||
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock lock(this->stateMutex);
|
||||
|
||||
if (this->nextPlayer) {
|
||||
this->StartWithPlayer(this->nextPlayer);
|
||||
startedNext = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!startedNext) {
|
||||
this->SetPlaybackState(Transport::PlaybackStopped);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user