]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11788: JB: fix packets per video frame count and allow count on vbw
authorDragos Oancea <dragos@signalwire.com>
Tue, 16 Apr 2019 19:43:40 +0000 (19:43 +0000)
committerDragos Oancea <dragos@signalwire.com>
Thu, 25 Jul 2019 21:43:27 +0000 (21:43 +0000)
src/switch_jitterbuffer.c

index 9d8e8c7e1c8d08e672c17a6719ea6683dd9893a2..15f8f6269f6e7afc0b4b9d634b64860dbbbd16d4 100644 (file)
@@ -687,13 +687,11 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch
                        jb->highest_wrote_ts = packet->header.ts;
                        jb->complete_frames++;
 
-                       if (!switch_test_flag(jb, SJB_QUEUE_ONLY)) {
-                               if (jb->packet_count > jb->max_packet_len) {
-                                       jb->max_packet_len = jb->packet_count;
-                               }
-                                       
-                               jb->packet_count = 0;
+                       jb->packet_count--;
+                       if (jb->packet_count > jb->max_packet_len) {
+                               jb->max_packet_len = jb->packet_count;
                        }
+                       jb->packet_count = 1;
                        node->complete_frame_mark = TRUE;
                } else if (!jb->write_init) {
                        jb->highest_wrote_ts = packet->header.ts;