From c112cb60dae542ba4b510a5d364410c7ce5f2aea Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Mon, 18 Oct 2021 16:39:08 +0200
Subject: [PATCH] output/snapcast: fix typo which caused "Failed to get chunk"

This bug caused a 9 second offset in all time stamps.  Due to that,
the Snapcast server thought the chunks are too old and discarded them.

Fixes https://github.com/MusicPlayerDaemon/MPD/discussions/1287
---
 NEWS                                     | 2 ++
 src/output/plugins/snapcast/Protocol.hxx | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index a4492a67b..e8b909ab0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
 ver 0.23.1 (not yet released)
+* output
+  - snapcast: fix time stamp bug which caused "Failed to get chunk"
 * fix libfmt linker problems
 * fix broken password authentication
 
diff --git a/src/output/plugins/snapcast/Protocol.hxx b/src/output/plugins/snapcast/Protocol.hxx
index 5e9e10aab..e8ae1dcd1 100644
--- a/src/output/plugins/snapcast/Protocol.hxx
+++ b/src/output/plugins/snapcast/Protocol.hxx
@@ -45,7 +45,7 @@ struct SnapcastTimestamp {
 
 		if (a_usec < b_usec) {
 			--result_sec;
-			result_usec += 1'000'0000;
+			result_usec += 1'000'000;
 		}
 
 		return {result_sec, result_usec};