Skip to content

Commit

Permalink
fix rtp read/write int64
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed Nov 18, 2023
1 parent a8a80e0 commit 35dfea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librtp/include/rtp-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline uint32_t rtp_read_uint32(const uint8_t* ptr)

static inline uint64_t rtp_read_uint64(const uint8_t* ptr)
{
return (((uint64_t)rtp_read_uint32(ptr)) << 32) | rtp_read_uint32(ptr + 8);
return (((uint64_t)rtp_read_uint32(ptr)) << 32) | rtp_read_uint32(ptr + 4);
}

static inline void rtp_write_uint16(uint8_t* ptr, uint16_t val)
Expand All @@ -42,7 +42,7 @@ static inline void rtp_write_uint32(uint8_t* ptr, uint32_t val)
static inline void rtp_write_uint64(uint8_t* ptr, uint64_t val)
{
rtp_write_uint32(ptr, (uint32_t)(val >> 32));
rtp_write_uint32(ptr + 8, (uint32_t)val);
rtp_write_uint32(ptr + 4, (uint32_t)val);
}

static inline void nbo_write_rtp_header(uint8_t *ptr, const rtp_header_t *header)
Expand Down

0 comments on commit 35dfea5

Please sign in to comment.