Attention is currently required from: falconia, neels.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32078 )
Change subject: osmo_rtp2trau() for FR & EFR: correctly handle the no-data case ......................................................................
Patch Set 1:
(2 comments)
File src/trau/trau_rtp_conv.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/32078/comment/eb96d53c_4bc0cec9 PS1, Line 282: } else if (data_len == 0) { : /* C1 .. C5: idle speech */ : tf->c_bits[0] = 0; : tf->c_bits[1] = 1; : tf->c_bits[2] = 1; : tf->c_bits[3] = 1; : tf->c_bits[4] = 0;
Please read the rules of TS 48.060, particularly sections 6.5.2 and 6.5.3. […]
I agree with your respons to neels' comment and I do know that the DL/UL are treated separtely. My objection was realted to the somewhat hard to follow control-flow where we have if (UL) {} else if {} (len ==0) else {}. It woul be better to split that up into a
if (UL) { } else { /* DL*/ if (len == 0) { } else { } }
so basically checking one thing per if/else, and not mixing two different things in one level. Alternatives would also be to use a switch statement for the UL/DL case. But in any case, don't mix the length check in the UL/DL decision.
https://gerrit.osmocom.org/c/libosmo-abis/+/32078/comment/d0946b55_da56a8fd PS1, Line 441: if (data_len == 0 && tf->dir == OSMO_TRAU_DIR_DL) {
In the present case (EFR codec) the answer to the "why" question is straightforward: because TS 48. […]
Done