mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-01 10:21:46 +02:00
Small time sync fix
This commit is contained in:
parent
d82c3c42ae
commit
83ab1cb260
2 changed files with 3 additions and 4 deletions
|
@ -628,9 +628,8 @@ void StreamServer::onMessageReceived(StreamSession* streamSession, const msg::Ba
|
||||||
timeMsg->deserialize(baseMessage, buffer);
|
timeMsg->deserialize(baseMessage, buffer);
|
||||||
timeMsg->refersTo = timeMsg->id;
|
timeMsg->refersTo = timeMsg->id;
|
||||||
timeMsg->latency = timeMsg->received - timeMsg->sent;
|
timeMsg->latency = timeMsg->received - timeMsg->sent;
|
||||||
// LOG(INFO) << "Latency sec: " << timeMsg.latency.sec << ", usec: " << timeMsg.latency.usec << ", refers to: " << timeMsg.refersTo <<
|
// LOG(INFO) << "Latency sec: " << timeMsg.latency.sec << ", usec: " << timeMsg.latency.usec << ", refers to: " << timeMsg.refersTo << "\n";
|
||||||
//"\n";
|
streamSession->sendAsync(timeMsg);
|
||||||
streamSession->sendAsync(timeMsg, true);
|
|
||||||
|
|
||||||
// refresh streamSession state
|
// refresh streamSession state
|
||||||
ClientInfoPtr client = Config::instance().getClientInfo(streamSession->clientId);
|
ClientInfoPtr client = Config::instance().getClientInfo(streamSession->clientId);
|
||||||
|
|
|
@ -166,8 +166,8 @@ void StreamSession::sendAsync(msg::message_ptr message, bool send_now)
|
||||||
if (!message)
|
if (!message)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// sendAsync(shared_const_buffer(*message), send_now);
|
|
||||||
tv t;
|
tv t;
|
||||||
|
// TODO: better set the timestamp in send_next for more accurate time sync
|
||||||
message->sent = t;
|
message->sent = t;
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
message->serialize(oss);
|
message->serialize(oss);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue