From ab139ffc8c0c8521058583b717568f6c15030c6e Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 21 Oct 2018 22:52:06 +0100 Subject: [PATCH] Fix calculation of filler length. --- player.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {