Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3071

to look at the new patch set (#4).

l1sap.c: Avoid sending RTP frame with empty payload

Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1

Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc
---
M src/common/l1sap.c
1 file changed, 24 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3071/4

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 1fb6134..80fafb8 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1011,22 +1011,32 @@
 
        msgb_pull(msg, sizeof(*l1sap));
 
-       /* hand msg to RTP code for transmission */
-       if (lchan->abis_ip.rtp_socket)
-               osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
-                       msg->data, msg->len, fn_ms_adj(fn, lchan), 
lchan->rtp_tx_marker);
-
-       /* if loopback is enabled, also queue received RTP data */
-       if (lchan->loopback) {
-               /* make sure the queue doesn't get too long */
-               queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1);
-               /* add new frame to queue */
-               msgb_enqueue(&lchan->dl_tch_queue, msg);
-               /* Return 1 to signal that we're still using msg and it should 
not be freed */
-               return 1;
+       /* Low level layers always call us when TCH content is expected to be
+        * available, even if the content is not available due to decoding
+        * issues. Content not available is expected as empty payload. */
+       if (msg->len) {
+               /* hand msg to RTP code for transmission */
+               if (lchan->abis_ip.rtp_socket)
+                       osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
+                               msg->data, msg->len, fn_ms_adj(fn, lchan), 
lchan->rtp_tx_marker);
+               /* if loopback is enabled, also queue received RTP data */
+               if (lchan->loopback) {
+                       /* make sure the queue doesn't get too long */
+                       queue_limit_to(gsm_lchan_name(lchan), 
&lchan->dl_tch_queue, 1);
+                       /* add new frame to queue */
+                       msgb_enqueue(&lchan->dl_tch_queue, msg);
+                       /* Return 1 to signal that we're still using msg and it 
should not be freed */
+                       return 1;
+               }
+               /* Only clear the marker bit once we have sent a RTP packet 
with it */
+               lchan->rtp_tx_marker = false;
+       } else {
+               DEBUGP(DL1P, "Skipping RTP frame with lost payload\n");
+               if (lchan->abis_ip.rtp_socket)
+                       osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, 
fn_ms_adj(fn, lchan));
+               lchan->rtp_tx_marker = true;
        }
 
-       lchan->rtp_tx_marker = false;
        lchan->tch.last_fn = fn;
        return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/3071
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to