From: Mike Brady Date: Sun, 21 Oct 2018 21:52:06 +0000 (+0100) Subject: Fix calculation of filler length. X-Git-Tag: 3.3RC0~190^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab139ffc8c0c8521058583b717568f6c15030c6e;p=thirdparty%2Fshairport-sync.git Fix calculation of filler length. --- diff --git a/player.c b/player.c index 3898c62d..2291182b 100644 --- a/player.c +++ b/player.c @@ -2085,7 +2085,7 @@ void *player_thread_func(void *arg) { // sync_error_out_of_bounds, sync_error); sync_error_out_of_bounds = 0; - int64_t filler_length = (int64_t)config.resyncthreshold * config.output_rate; // number of samples + int64_t filler_length = (int64_t)(config.resyncthreshold * config.output_rate); // number of samples if ((sync_error > 0) && (sync_error > filler_length)) { debug(1, "Large positive sync error: %" PRId64 ".", sync_error); frames_to_drop = sync_error / conn->output_sample_ratio; @@ -2098,6 +2098,7 @@ void *player_thread_func(void *arg) { char *long_silence = malloc(conn->output_bytes_per_frame * silence_length_sized); if (long_silence) { memset(long_silence, 0, conn->output_bytes_per_frame * silence_length_sized); + debug(1,"Play a silence of %d frames.",silence_length_sized); config.output->play(long_silence, silence_length_sized); free(long_silence); } else {