pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-netif/+/29497 )
Change subject: osmux: Avoid duplicated RTP msg trigger Tx of osmux frame
......................................................................
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(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
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
https://gerrit.osmocom.org/c/libosmo-netif/+/29497
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Idc457bc3b26bed68796d714bc3f37a2d016ba5c3
Gerrit-Change-Number: 29497
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged