From 2e7a15a9987615b10460e7717f3a0dd31774936e Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 23 Sep 2024 22:32:02 +0200 Subject: [PATCH] Remove unused audio player fields They are only used locally. --- app/src/audio_player.c | 4 +--- app/src/audio_player.h | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/audio_player.c b/app/src/audio_player.c index 274b6948..24144483 100644 --- a/app/src/audio_player.c +++ b/app/src/audio_player.c @@ -351,8 +351,6 @@ sc_audio_player_frame_sink_open(struct sc_frame_sink *sink, assert(out_bytes_per_sample > 0); ap->sample_rate = ctx->sample_rate; - ap->nb_channels = nb_channels; - ap->out_bytes_per_sample = out_bytes_per_sample; ap->target_buffering = ap->target_buffering_delay * ap->sample_rate / SC_TICK_FREQ; @@ -413,7 +411,7 @@ sc_audio_player_frame_sink_open(struct sc_frame_sink *sink, // without locking. uint32_t audiobuf_samples = ap->target_buffering + ap->sample_rate; - size_t sample_size = ap->nb_channels * ap->out_bytes_per_sample; + size_t sample_size = nb_channels * out_bytes_per_sample; bool ok = sc_audiobuf_init(&ap->buf, sample_size, audiobuf_samples); if (!ok) { goto error_free_swr_ctx; diff --git a/app/src/audio_player.h b/app/src/audio_player.h index 3d468999..e638e601 100644 --- a/app/src/audio_player.h +++ b/app/src/audio_player.h @@ -41,10 +41,6 @@ struct sc_audio_player { // The sample rate is the same for input and output unsigned sample_rate; - // The number of channels is the same for input and output - unsigned nb_channels; - // The number of bytes per sample for a single channel - size_t out_bytes_per_sample; // Target buffer for resampling (only used by the receiver thread) uint8_t *swr_buf;