Skip to content

Commit

Permalink
A few more fixes from static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Sep 10, 2024
1 parent 5ce0537 commit 7e6c4a4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ gboolean janus_ice_is_enforced(const char *ip) {
const char *enforced = (const char *)temp->data;
if(enforced != NULL && strstr(ip, enforced) == ip) {
janus_mutex_unlock(&ice_list_mutex);
return true;
return TRUE;
}
temp = temp->next;
}
Expand Down Expand Up @@ -407,7 +407,7 @@ gboolean janus_ice_is_ignored(const char *ip) {
const char *ignored = (const char *)temp->data;
if(ignored != NULL && strstr(ip, ignored) == ip) {
janus_mutex_unlock(&ice_list_mutex);
return true;
return TRUE;
}
temp = temp->next;
}
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -4513,7 +4513,6 @@ json_t *janus_videoroom_query_session(janus_plugin_session *handle) {
janus_mutex_unlock(&sessions_mutex);
/* Show the participant/room info, if any */
json_t *info = json_object();
janus_mutex_lock(&session->mutex);
if(session->participant) {
if(session->participant_type == janus_videoroom_p_type_none) {
json_object_set_new(info, "type", json_string("none"));
Expand Down Expand Up @@ -4606,7 +4605,6 @@ json_t *janus_videoroom_query_session(janus_plugin_session *handle) {
}
json_object_set_new(info, "hangingup", json_integer(g_atomic_int_get(&session->hangingup)));
json_object_set_new(info, "destroyed", json_integer(g_atomic_int_get(&session->destroyed)));
janus_mutex_unlock(&session->mutex);
janus_refcount_decrease(&session->ref);
return info;
}
Expand Down
4 changes: 2 additions & 2 deletions src/postprocessing/janus-pp-rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,8 +1652,8 @@ static gint janus_pp_skew_compensate_audio(janus_pp_frame_packet *pkt, janus_pp_
exit_status = -1;
} else {
context->target_ts = 0;
/* Do not execute analysis for out of order packets or multi-packets frame or if pts < start_time */
if (context->last_seq == context->prev_seq + 1 && context->last_ts != context->prev_ts && pts >= context->start_time) {
/* Do not execute analysis for out of order packets or multi-packets frame or if pts < start_time */
if (context->last_seq == context->prev_seq + 1 && context->last_ts != context->prev_ts && pts >= context->start_time) {
/* Evaluate the local RTP timestamp according to the local clock */
guint64 expected_ts = ((pts - context->start_time) * akhz) + context->start_ts;
/* Evaluate current delay */
Expand Down
8 changes: 5 additions & 3 deletions src/postprocessing/pp-h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ static uint32_t janus_pp_h264_eg_decode(uint8_t *base, uint32_t *offset) {
while(janus_pp_h264_eg_getbit(base, (*offset)++) == 0)
zeros++;
uint32_t res = 1 << zeros;
uint32_t i = 0;
for(i=zeros-1; i>=0; i--) {
res |= janus_pp_h264_eg_getbit(base, (*offset)++) << i;
if(zeros > 0) {
int32_t i = 0;
for(i=zeros-1; i>=0; i--) {
res |= janus_pp_h264_eg_getbit(base, (*offset)++) << i;
}
}
return res-1;
}
Expand Down
8 changes: 5 additions & 3 deletions src/postprocessing/pp-h265.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ static uint32_t janus_pp_h265_eg_decode(uint8_t *base, uint32_t *offset) {
while(janus_pp_h265_eg_getbit(base, (*offset)++) == 0)
zeros++;
uint32_t res = 1 << zeros;
uint32_t i = 0;
for(i=zeros-1; i>=0; i--) {
res |= janus_pp_h265_eg_getbit(base, (*offset)++) << i;
if(zeros > 0) {
int32_t i = 0;
for(i=zeros-1; i>=0; i--) {
res |= janus_pp_h265_eg_getbit(base, (*offset)++) << i;
}
}
return res-1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/turnrest.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ janus_turnrest_response *janus_turnrest_request(const char *user) {
/* FIXME Some servers don't like a POST with no data */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, query_string);
}
janus_mutex_unlock(&api_mutex);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, api_timeout);
janus_mutex_unlock(&api_mutex);
/* For getting data, we use an helper struct and the libcurl callback */
janus_turnrest_buffer data;
data.buffer = g_malloc0(1);
Expand Down

0 comments on commit 7e6c4a4

Please sign in to comment.