Skip to content

Commit

Permalink
Compile bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanov Kirill committed May 7, 2021
1 parent 4fdcec9 commit ede1660
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ static void *janus_streaming_handler(void *data);
#define DEFAULT_RTP_RANGE_MAX 60000
static uint16_t rtp_range_min = DEFAULT_RTP_RANGE_MIN;
static uint16_t rtp_range_max = DEFAULT_RTP_RANGE_MAX;
static uint16_t rtp_range_slider = DEFAULT_RTP_RANGE_MIN;
static gint rtp_range_slider = DEFAULT_RTP_RANGE_MIN;
static janus_mutex fd_mutex = JANUS_MUTEX_INITIALIZER;

static void *janus_streaming_ondemand_thread(void *data);
Expand Down Expand Up @@ -5438,12 +5438,12 @@ static int janus_streaming_create_fd(int port, in_addr_t mcast, const janus_netw
uint16_t rtp_port_next; /* Read global slider */

while(1){
rtp_port_next = rtp_range_slider;
rtp_port_next = (uint16_t)rtp_range_slider;

if(rtp_port_next > rtp_range_max || rtp_port_next < rtp_range_min)
rtp_port_next = rtp_range_min;

uint16_t rtp_range_slider_next = (uint16_t)(rtp_port_next + 1);
gint rtp_range_slider_next = rtp_port_next + 1;

if(g_atomic_int_compare_and_exchange(&rtp_range_slider, rtp_range_slider, rtp_range_slider_next))
break;
Expand Down Expand Up @@ -5622,7 +5622,7 @@ static int janus_streaming_allocate_port_pair(const char *name, const char *medi
uint16_t rtp_port_next;

while(1){
rtp_port_next = rtp_range_slider;
rtp_port_next = (uint16_t)rtp_range_slider;

if(rtp_port_next % 2 != 0) /* We want an even port for RTP */
rtp_port_next++;
Expand All @@ -5635,8 +5635,8 @@ static int janus_streaming_allocate_port_pair(const char *name, const char *medi
rtp_port_next++;
}

uint16_t rtcp_port_next = (uint16_t)(rtp_port_next + 1);
uint16_t rtp_range_slider_next = (uint16_t)(rtcp_port_next + 1);
gint rtcp_port_next = rtp_port_next + 1;
gint rtp_range_slider_next = rtcp_port_next + 1;

if(g_atomic_int_compare_and_exchange(&rtp_range_slider, rtp_range_slider, rtp_range_slider_next))
break;
Expand Down

0 comments on commit ede1660

Please sign in to comment.