falconia has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/37286?usp=email )

Change subject: trau_frame: fix 8k decoding
......................................................................

trau_frame: fix 8k decoding

osmo_trau_frame_decode_8k() API was broken for most TRAU frame types:
the processing begins with identifying the sync pattern, but the check
for the leading 8 zeros in HRv1, AMR-low and AMR-6k7 formats was
broken in that it was checking for 16 zero bits instead of 8.

While at it, fix global namespace pollution: the bit8_0[] datum
used in this logic was defined as global when it should be static.

Change-Id: Idabc1283d477473b479f2d76d783ca9aeaf0af5d
---
M src/trau/trau_frame.c
1 file changed, 18 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c
index 389495c..98e26da 100644
--- a/src/trau/trau_frame.c
+++ b/src/trau/trau_frame.c
@@ -1360,7 +1360,7 @@
 #define TRAU8_FT_AMR_NO_SPEECH_CMR     0x14    /* 1, 0, 1, 0, 0 */
 #define TRAU8_FT_AMR_475_515_590       0..7

-const uint8_t bit8_0[16] = { 0,  };
+static const uint8_t bit8_0[8] = { 0,  };

 /*!< check sync pattern for hr/data/oam */
 static bool is_hr(const ubit_t *bits)

--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/37286?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Idabc1283d477473b479f2d76d783ca9aeaf0af5d
Gerrit-Change-Number: 37286
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <fal...@freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: falconia <fal...@freecalypso.org>
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-CC: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to