potential mixed signed/unsigned arithmetic issues

This commit is contained in:
philippe44
2019-08-18 23:41:04 -07:00
parent 82a5758f6e
commit 9caf8deca6

View File

@@ -103,8 +103,8 @@ typedef struct rtp_s {
#else
mbedtls_aes_context aes;
#endif
bool decrypt;
u8_t *decrypt_buf;
bool decrypt;
u8_t *decrypt_buf;
u32_t frame_size, frame_duration;
u32_t in_frames, out_frames;
struct in_addr host;
@@ -128,7 +128,6 @@ typedef struct rtp_s {
int latency; // rtp hold depth in samples
u32_t resent_req, resent_rec; // total resent + recovered frames
u32_t silent_frames; // total silence frames
u32_t filled_frames; // silence frames in current silence episode
u32_t filled_frames; // silence frames in current silence episode
u32_t discarded;
abuf_t audio_buffer[BUFFER_FRAMES];
@@ -402,7 +401,6 @@ static void buffer_put_packet(rtp_t *ctx, seq_t seqno, unsigned rtptime, bool fi
if (!ctx->playing) {
if ((ctx->flush_seqno == -1 || seq_order(ctx->flush_seqno, seqno)) &&
(ctx->synchro.status & RTP_SYNC && ctx->synchro.status & NTP_SYNC)) {
ctx->ab_write = seqno-1;
ctx->ab_write = seqno-1;
ctx->ab_read = seqno;
ctx->flush_seqno = -1;
@@ -494,7 +492,7 @@ static void buffer_push_packet(rtp_t *ctx) {
curframe = ctx->audio_buffer + BUFIDX(ctx->ab_read);
playtime = ctx->synchro.time + (((s32_t)(curframe->rtptime - ctx->synchro.rtp)) * 10) / 441;
if (now > playtime) {
LOG_INFO("[%p]: discarded frame now:%u missed by %d (W:%hu R:%hu)", ctx, now, now - playtime, ctx->ab_write, ctx->ab_read);
ctx->discarded++;