pespin has uploaded this change for review.

View Change

osmux: Avoid duplicated RTP msg trigger Tx of osmux frame

The RTP msg will be dropped, so it makes no sense to signal the caller
to deliver the batchbeing built, since it may still have space for next
non-duplicated message.

The exception is the case where the new packet has the M marker bit set,
since the sequence numbers can be reset or jump in those scenarios.

Change-Id: Idc457bc3b26bed68796d714bc3f37a2d016ba5c3
---
M src/osmux.c
1 file changed, 10 insertions(+), 10 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/97/29497/1
diff --git a/src/osmux.c b/src/osmux.c
index 4851998..51642ab 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -691,22 +691,12 @@
return -1;
}

- /* First check if there is room for this message in the batch */
- bytes += amr_payload_len;
- if (circuit->nmsgs == 0)
- bytes += sizeof(struct osmux_hdr);
-
- /* No room, sorry. You'll have to retry */
- if (bytes > batch->remaining_bytes)
- return 1;
-
/* Init of talkspurt (RTP M marker bit) needs to be in the first AMR slot
* of the OSMUX packet, enforce sending previous batch if required:
*/
if (rtph->marker && circuit->nmsgs != 0)
return 1;

-
/* Extra validation: check if this message already exists, should not
* happen but make sure we don't propagate duplicated messages.
*/
@@ -723,6 +713,16 @@
return -1;
}
}
+
+ /* First check if there is room for this message in the batch */
+ bytes += amr_payload_len;
+ if (circuit->nmsgs == 0)
+ bytes += sizeof(struct osmux_hdr);
+
+ /* No room, sorry. You'll have to retry */
+ if (bytes > batch->remaining_bytes)
+ return 1;
+
/* Handle RTP packet loss scenario */
osmux_replay_lost_packets(circuit, rtph, batch_factor);


To view, visit change 29497. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Idc457bc3b26bed68796d714bc3f37a2d016ba5c3
Gerrit-Change-Number: 29497
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange