try to fix misc cspot issues + silence network manager log

This commit is contained in:
philippe44
2022-09-12 11:54:49 -07:00
parent a8e28f9ff0
commit 922889fee2
9 changed files with 45 additions and 30 deletions

View File

@@ -114,7 +114,7 @@ void Player::runTask()
}
else
{
usleep(10000);
usleep(20000);
}
}
@@ -147,7 +147,7 @@ void Player::cancelCurrentTrack()
}
}
void Player::handleLoad(std::shared_ptr<TrackReference> trackReference, std::function<void()>& trackLoadedCallback, uint32_t position_ms, bool isPaused)
void Player::handleLoad(std::shared_ptr<TrackReference> trackReference, std::function<void(bool)>& trackLoadedCallback, uint32_t position_ms, bool isPaused)
{
std::lock_guard<std::mutex> guard(loadTrackMutex);
@@ -166,7 +166,9 @@ void Player::handleLoad(std::shared_ptr<TrackReference> trackReference, std::fun
this->nextTrack->trackInfoReceived = this->trackChanged;
this->nextTrack->loadedTrackCallback = [this, framesCallback, trackLoadedCallback]() {
trackLoadedCallback();
bool needFlush = currentTrack != nullptr && currentTrack->audioStream != nullptr && currentTrack->audioStream->isRunning;
cancelCurrentTrack();
trackLoadedCallback(needFlush);
this->nextTrackMutex.lock();
this->nextTrack->audioStream->streamFinishedCallback = this->endOfFileCallback;
@@ -175,7 +177,6 @@ void Player::handleLoad(std::shared_ptr<TrackReference> trackReference, std::fun
this->nextTrack->loaded = true;
this->nextTrackMutex.unlock();
cancelCurrentTrack();
};
this->nextTrackMutex.unlock();
}