File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -187,9 +187,10 @@ class SnapOutput {
187
187
// / ignored - update playback speed
188
188
bool synchronizePlayback () {
189
189
bool result = true ;
190
+ SnapTimeSync& ts = *p_snap_time_sync;
190
191
192
+ // calculate how long we need to wait to playback the audio
191
193
auto delay_ms = getDelayMs ();
192
- SnapTimeSync& ts = *p_snap_time_sync;
193
194
194
195
if (!is_sync_started) {
195
196
@@ -198,6 +199,8 @@ class SnapOutput {
198
199
// start audio when first package in the future becomes valid
199
200
result = synchronizeOnStart (delay_ms);
200
201
} else {
202
+ // provide the actual delay to the synch
203
+ ts.updateActualDelay (delay_ms);
201
204
202
205
if (ts.isSync ()) {
203
206
// update speed
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ class SnapTimeSync {
27
27
// / Records the actual server time in millisecondes
28
28
virtual void updateServerTime (uint32_t serverMillis) = 0;
29
29
30
+ // / Records the actual playback delay (currently not used)
31
+ virtual void updateActualDelay (int delay) {}
32
+
30
33
// / Calculate the resampling factor: with a positive delay we play too fast
31
34
// / and need to slow down
32
35
virtual float getFactor () = 0;
You can’t perform that action at this time.
0 commit comments