mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 21:17:18 +03:00
filter out AirPlay erroneous sync point - release
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <openssl/aes.h>
|
#include <openssl/aes.h>
|
||||||
#include "alac_wrapper.h"
|
#include "alac_wrapper.h"
|
||||||
|
#define MSG_DONTWAIT 0
|
||||||
#else
|
#else
|
||||||
#include "esp_pthread.h"
|
#include "esp_pthread.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|||||||
@@ -206,6 +206,10 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args)
|
|||||||
// in how many ms will the most recent block play
|
// in how many ms will the most recent block play
|
||||||
ms = ((u64_t) ((_buf_used(outputbuf) - raop_sync.len) / BYTES_PER_FRAME + output.device_frames + output.frames_in_process) * 1000) / RAOP_SAMPLE_RATE - (now - output.updated);
|
ms = ((u64_t) ((_buf_used(outputbuf) - raop_sync.len) / BYTES_PER_FRAME + output.device_frames + output.frames_in_process) * 1000) / RAOP_SAMPLE_RATE - (now - output.updated);
|
||||||
raop_sync.error[raop_sync.idx] = (raop_sync.playtime - now) - ms;
|
raop_sync.error[raop_sync.idx] = (raop_sync.playtime - now) - ms;
|
||||||
|
if (abs(raop_sync.error[raop_sync.idx]) > 1000) {
|
||||||
|
LOG_INFO("erroneous sync point %d", raop_sync.error[raop_sync.idx]);
|
||||||
|
raop_sync.error[raop_sync.idx] = raop_sync.error[raop_sync.idx] > 0 ? 1000 : -1000;
|
||||||
|
}
|
||||||
sync_nb = SYNC_NB;
|
sync_nb = SYNC_NB;
|
||||||
LOG_DEBUG("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, raop_sync.error[raop_sync.idx]);
|
LOG_DEBUG("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, raop_sync.error[raop_sync.idx]);
|
||||||
LOG_DEBUG("obuf:%u, sync_len:%u, devframes:%u, inproc:%u", _buf_used(outputbuf), raop_sync.len, output.device_frames, output.frames_in_process);
|
LOG_DEBUG("obuf:%u, sync_len:%u, devframes:%u, inproc:%u", _buf_used(outputbuf), raop_sync.len, output.device_frames, output.frames_in_process);
|
||||||
|
|||||||
Reference in New Issue
Block a user