|
@@ -201,21 +201,23 @@ void SpircHandler::handleFrame(std::vector<uint8_t>& data) {
|
|
|
break;
|
|
|
}
|
|
|
case MessageType_kMessageTypeReplace: {
|
|
|
- CSPOT_LOG(debug, "Got replace frame %d", playbackState->remoteTracks.size());
|
|
|
+ CSPOT_LOG(debug, "Got replace frame %d",
|
|
|
+ playbackState->remoteTracks.size());
|
|
|
playbackState->syncWithRemote();
|
|
|
|
|
|
// 1st track is the current one, but update the position
|
|
|
bool cleared = trackQueue->updateTracks(
|
|
|
playbackState->remoteFrame.state.position_ms +
|
|
|
- ctx->timeProvider->getSyncedTimestamp() -
|
|
|
- playbackState->innerFrame.state.position_measured_at);
|
|
|
+ ctx->timeProvider->getSyncedTimestamp() -
|
|
|
+ playbackState->innerFrame.state.position_measured_at,
|
|
|
+ false);
|
|
|
|
|
|
this->notify();
|
|
|
|
|
|
// need to re-load all if streaming track is completed
|
|
|
if (cleared) {
|
|
|
- sendEvent(EventType::FLUSH);
|
|
|
- trackPlayer->resetState();
|
|
|
+ sendEvent(EventType::FLUSH);
|
|
|
+ trackPlayer->resetState();
|
|
|
}
|
|
|
break;
|
|
|
}
|