Skip to content

Commit

Permalink
MT#55283 extend lock duration
Browse files Browse the repository at this point in the history
`next_exp_seq` must also be protected by the mutex.

Change-Id: I2fb223d9b29c891e45430887bfb3549d1a85b653
Warned-by: Coverity
  • Loading branch information
rfuchs committed Oct 3, 2024
1 parent 59ac21c commit 295b75b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daemon/jitter_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ static void set_jitter_values(struct media_packet *mp) {
if(rtp_pt->codec_def && rtp_pt->codec_def->dtmf)
dtmf = 1;
}
mutex_lock(&jb->lock);
if(jb->next_exp_seq && !dtmf) {
mutex_lock(&jb->lock);
if(curr_seq > jb->next_exp_seq) {
int marker = (mp->rtp->m_pt & 0x80) ? 1 : 0;
if(!marker) {
Expand All @@ -382,10 +382,10 @@ static void set_jitter_values(struct media_packet *mp) {

if(jb->cont_miss >= CONT_MISS_COUNT)
reset_jitter_buffer(jb);
mutex_unlock(&jb->lock);
}
if(curr_seq >= jb->next_exp_seq)
jb->next_exp_seq = curr_seq + 1;
mutex_unlock(&jb->lock);
}

static void __jb_send_later(struct timerthread_queue *ttq, void *p) {
Expand Down

0 comments on commit 295b75b

Please sign in to comment.