]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11750: don't shrink NACK table (vbw) so drastically (don't drop a frame with every...
authorDragos Oancea <dragos@signalwire.com>
Tue, 2 Apr 2019 16:59:45 +0000 (16:59 +0000)
committerDragos Oancea <dragos@signalwire.com>
Thu, 6 Jun 2019 17:01:36 +0000 (17:01 +0000)
src/switch_jitterbuffer.c

index a709502107256e3749066be88a281dc7ab94a55f..d823e4709b2f047d4fb47a6b4f87d1f737cf08ba 100644 (file)
@@ -1251,8 +1251,11 @@ SWITCH_DECLARE(switch_status_t) switch_jb_put_packet(switch_jb_t *jb, switch_rtp
 
        add_node(jb, packet, len);
 
-       if (switch_test_flag(jb, SJB_QUEUE_ONLY) && jb->complete_frames > jb->max_frame_len) {
-               drop_oldest_frame(jb);
+       if (switch_test_flag(jb, SJB_QUEUE_ONLY) && jb->max_packet_len 
+                       && jb->allocated_nodes > jb->max_frame_len * 2 - 1) {
+               while ((jb->max_frame_len * 2 - jb->visible_nodes) < jb->max_packet_len) {
+                       drop_oldest_frame(jb);
+               }
        }
 
        switch_mutex_unlock(jb->mutex);