]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-639
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 2 Aug 2010 18:48:35 +0000 (13:48 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 2 Aug 2010 18:48:35 +0000 (13:48 -0500)
src/switch_rtp.c

index cec5c6be358b2ee1128db012b80c0aba18505c2e..efe7a2b8a383117c449a0a95b76fd1303d18c158 100644 (file)
@@ -2107,14 +2107,21 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
                                                                                         &rb);
                        
                        if ((rstatus != SWITCH_STATUS_SUCCESS && rstatus != SWITCH_STATUS_BREAK) || rb < 0) {
-                               *bytes = rb;
-                               return rstatus;
+                               if (rtp_session->recv_msg_idx) {
+                                       /* Handle the data we have queued up */
+                                       break;
+                               } else {
+                                       *bytes = rb;
+                                       return rstatus;
+                               }
                        }
                        
                        if (!rb) break;
                        
                        rtp_session->recv_msg_array[rtp_session->recv_msg_idx].bytes = rb;
                        rtp_session->recv_msg_idx++;
+
+                       switch_cond_next(); /* Relax just a bit */
                }
 
                if (!*bytes && rtp_session->recv_msg_idx) goto top;