Remove unused audio player fields

They are only used locally.
This commit is contained in:
Romain Vimont 2024-09-23 22:32:02 +02:00
parent a7e61fb871
commit 2e7a15a998
2 changed files with 1 additions and 7 deletions

View File

@ -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;

View File

@ -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;