Skip to content

Commit

Permalink
MT#55283 unify types used for sequence numbers
Browse files Browse the repository at this point in the history
We use int or unsigned int everywhere, except in a few leftover places.
Unify to (unsigned) int.

Change-Id: I0896b2f177957c17b30a3d0cb6b3fb2beb4bd684
(cherry picked from commit f60ee91)
  • Loading branch information
rfuchs committed Oct 9, 2024
1 parent 68f8af3 commit cef1401
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions daemon/media_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2694,10 +2694,10 @@ static int stream_packet(struct packet_handler_ctx *phc) {
atomic64_inc_na(&phc->mp.ssrc_in->stats->packets);
atomic64_add_na(&phc->mp.ssrc_in->stats->bytes, phc->s.len);
// no real sequencing, so this is rudimentary
uint64_t old_seq = atomic_get_na(&phc->mp.ssrc_in->stats->ext_seq);
uint64_t new_seq = ntohs(phc->mp.rtp->seq_num) | (old_seq & 0xffff0000UL);
unsigned int old_seq = atomic_get_na(&phc->mp.ssrc_in->stats->ext_seq);
unsigned int new_seq = ntohs(phc->mp.rtp->seq_num) | (old_seq & 0xffff0000UL);
// XXX combine this with similar code elsewhere
long seq_diff = new_seq - old_seq;
int seq_diff = new_seq - old_seq;
while (seq_diff < -60000) {
new_seq += 0x10000;
seq_diff += 0x10000;
Expand Down
4 changes: 2 additions & 2 deletions daemon/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ INLINE int check_session_keys(struct crypto_context *c) {
return -1;
}

static uint64_t packet_index(struct ssrc_ctx *ssrc_ctx, struct rtp_header *rtp) {
static unsigned int packet_index(struct ssrc_ctx *ssrc_ctx, struct rtp_header *rtp) {
uint16_t seq;

seq = ntohs(rtp->seq_num);
Expand Down Expand Up @@ -103,7 +103,7 @@ void rtp_append_mki(str *s, struct crypto_context *c) {
int rtp_avp2savp(str *s, struct crypto_context *c, struct ssrc_ctx *ssrc_ctx) {
struct rtp_header *rtp;
str payload, to_auth;
uint64_t index;
unsigned int index;

if (G_UNLIKELY(!ssrc_ctx))
return -1;
Expand Down

0 comments on commit cef1401

Please sign in to comment.