Use exact-width integer types

This commit is contained in:
Romain Vimont 2024-09-23 23:11:03 +02:00
parent 42fb947780
commit 10f60054ac
2 changed files with 5 additions and 5 deletions

View File

@ -342,12 +342,12 @@ sc_audio_player_frame_sink_open(struct sc_frame_sink *sink,
const AVCodecContext *ctx) {
struct sc_audio_player *ap = DOWNCAST(sink);
#ifdef SCRCPY_LAVU_HAS_CHLAYOUT
assert(ctx->ch_layout.nb_channels > 0);
unsigned nb_channels = ctx->ch_layout.nb_channels;
assert(ctx->ch_layout.nb_channels > 0 && ctx->ch_layout.nb_channels < 256);
uint8_t nb_channels = ctx->ch_layout.nb_channels;
#else
int tmp = av_get_channel_layout_nb_channels(ctx->channel_layout);
assert(tmp > 0);
unsigned nb_channels = tmp;
assert(tmp > 0 && tmp < 256);
uint8_t nb_channels = tmp;
#endif
assert(ctx->sample_rate > 0);

View File

@ -42,7 +42,7 @@ struct sc_audio_player {
struct SwrContext *swr_ctx;
// The sample rate is the same for input and output
unsigned sample_rate;
uint32_t sample_rate;
// Target buffer for resampling (only used by the receiver thread)
uint8_t *swr_buf;