Skip to content

Commit a44ebb6

Browse files
committed
Use a try_pop when clearing the AudioBridge participant buffer (see #3570)
1 parent c3be8e7 commit a44ebb6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/plugins/janus_audiobridge.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,9 +1885,11 @@ static void janus_audiobridge_participant_clear_inbuf(janus_audiobridge_particip
18851885

18861886
static void janus_audiobridge_participant_clear_outbuf(janus_audiobridge_participant *participant) {
18871887
while(participant->outbuf && g_async_queue_length(participant->outbuf) > 0) {
1888-
janus_audiobridge_rtp_relay_packet *pkt = g_async_queue_pop(participant->outbuf);
1889-
g_free(pkt->data);
1890-
g_free(pkt);
1888+
janus_audiobridge_rtp_relay_packet *pkt = g_async_queue_try_pop(participant->outbuf);
1889+
if(pkt) {
1890+
g_free(pkt->data);
1891+
g_free(pkt);
1892+
}
18911893
}
18921894
}
18931895

0 commit comments

Comments
 (0)