]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix calculation of filler length.
authorMike Brady <mikebrady@eircom.net>
Sun, 21 Oct 2018 21:52:06 +0000 (22:52 +0100)
committerMike Brady <mikebrady@eircom.net>
Sun, 21 Oct 2018 21:52:06 +0000 (22:52 +0100)
player.c

index 3898c62df03aedf1834c061a89e0bae37f507863..2291182b8b0a54f49236c863aab2a01b2f185838 100644 (file)
--- 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 {