Skip to content

Commit 0a8df39

Browse files
committed
Changed startup delay logic
1 parent 26c3728 commit 0a8df39

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/SnapConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# define CONFIG_CLIENT_TIMEOUT_SEC 5
4242
#endif
4343
#ifndef CONFIG_PROCESSING_TIME_MS
44-
# define CONFIG_PROCESSING_TIME_MS 172
44+
# define CONFIG_PROCESSING_TIME_MS -172
4545
#endif
4646
#ifndef CONFIG_STREAMIN_DECODER_BUFFER
4747
# define CONFIG_STREAMIN_DECODER_BUFFER (12 * 1024)

src/api/SnapTimeSync.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ class SnapTimeSync {
5858
/// Provides the effective delay to be used (Message buffer lag -
5959
/// decoding/playback time)
6060
int getStartDelay() {
61-
int delay = std::max(0, message_buffer_delay_ms - processing_lag);
61+
int delay = std::max(0, message_buffer_delay_ms + processing_lag);
62+
if (message_buffer_delay_ms + processing_lag < 0){
63+
LOGE("The processing lag can not be smaller then -%d", message_buffer_delay_ms);
64+
}
6265
ESP_LOGD(TAG, "delay: %d", delay);
6366
return delay;
6467
}

0 commit comments

Comments
 (0)