Skip to content

Commit e0974fa

Browse files
committed
Merge branch 'bugfix/fix_data_queue_logic_wrong' into 'main'
Fix data queue read write dead loop for status not sync See merge request adf/esp-webrtc-solution!49
2 parents a4a4eb9 + 063253b commit e0974fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/media_lib_sal/port/data_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ int data_queue_read_lock(data_queue_t *q, void **buffer, int *size)
348348
if (data_size < 0 || data_size >q->size) {
349349
*(int*)0 = 0;
350350
}
351-
q->filled -= data_size;
352351
*buffer = data_buffer + DATA_Q_ALLOC_HEAD_SIZE;
353352
*size = data_size - DATA_Q_ALLOC_HEAD_SIZE;
354353
q->user++;
@@ -383,6 +382,7 @@ int data_queue_read_unlock(data_queue_t *q)
383382
*(int*)0 = 0;
384383
}
385384
q->rp += size;
385+
q->filled -= size;
386386
if (q->fill_end && q->rp >= q->fill_end) {
387387
q->fill_end = 0;
388388
q->rp = 0;

0 commit comments

Comments
 (0)