From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 3 Jun 2021 08:21:14 +0000 (+0100) Subject: Add 100 ms to the amount to flush after a large positive sync error to give the syste... X-Git-Tag: 4.1-dev~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcad9d5998cc64ac811380e27c3329e8f045bb98;p=thirdparty%2Fshairport-sync.git Add 100 ms to the amount to flush after a large positive sync error to give the system a better chance to recover in one attempt. --- diff --git a/player.c b/player.c index f16c5021..4c13b2ef 100644 --- a/player.c +++ b/player.c @@ -2406,8 +2406,13 @@ void *player_thread_func(void *arg) { sync_error, (sync_error * 1.0) / config.output_rate, inframe->given_timestamp); int64_t local_frames_to_drop = sync_error / conn->output_sample_ratio; + + // add 100 ms to give the pipeline a chance to recover -- a bit hacky + local_frames_to_drop += (conn->input_rate) * 100 / 1000; + uint32_t frames_to_drop_sized = local_frames_to_drop; do_flush(inframe->given_timestamp + frames_to_drop_sized, conn); + } else if ((sync_error < 0) && ((-sync_error) > filler_length)) { debug(1, "Large negative sync error of: %" PRId64