Skip to content

Commit 08515f7

Browse files
committed
Additional info to synch
1 parent 51c89d6 commit 08515f7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/api/SnapOutput.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ class SnapOutput {
187187
/// ignored - update playback speed
188188
bool synchronizePlayback() {
189189
bool result = true;
190+
SnapTimeSync& ts = *p_snap_time_sync;
190191

192+
// calculate how long we need to wait to playback the audio
191193
auto delay_ms = getDelayMs();
192-
SnapTimeSync& ts = *p_snap_time_sync;
193194

194195
if (!is_sync_started) {
195196

@@ -198,6 +199,8 @@ class SnapOutput {
198199
// start audio when first package in the future becomes valid
199200
result = synchronizeOnStart(delay_ms);
200201
} else {
202+
// provide the actual delay to the synch
203+
ts.updateActualDelay(delay_ms);
201204

202205
if (ts.isSync()) {
203206
// update speed

src/api/SnapTimeSync.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class SnapTimeSync {
2727
/// Records the actual server time in millisecondes
2828
virtual void updateServerTime(uint32_t serverMillis) = 0;
2929

30+
/// Records the actual playback delay (currently not used)
31+
virtual void updateActualDelay(int delay) {}
32+
3033
/// Calculate the resampling factor: with a positive delay we play too fast
3134
/// and need to slow down
3235
virtual float getFactor() = 0;

0 commit comments

Comments
 (0)