From 80a6fa7a01f019e59e95bfcca47de1a80fe17c6a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 12 Mar 2023 08:37:08 +0100 Subject: [PATCH] Fix comparison warning An int was compared with an unsigned: ../app/src/audio_player.c:290:27: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] if (abs(diff) < ap->sample_rate / 1000) { ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ --- app/src/audio_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/audio_player.c b/app/src/audio_player.c index 5abc9088..bba39acb 100644 --- a/app/src/audio_player.c +++ b/app/src/audio_player.c @@ -287,7 +287,7 @@ sc_audio_player_frame_sink_push(struct sc_frame_sink *sink, float avg = sc_average_get(&ap->avg_buffering); int diff = ap->target_buffering - avg; - if (abs(diff) < ap->sample_rate / 1000) { + if (abs(diff) < (int) ap->sample_rate / 1000) { // Do not compensate for less than 1ms, the error is just noise diff = 0; } else if (diff < 0 && buffered_samples < ap->target_buffering) {