[PATCH] libosmocore[master]: DTX: fix AMR SID-FIRST detection

Max gerrit-no-reply at lists.osmocom.org
Tue Jan 10 09:29:33 UTC 2017


Review at  https://gerrit.osmocom.org/1552

DTX: fix AMR SID-FIRST detection

Max's note: adjusted test output.

Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc
Related: OS#1801
---
M src/codec/gsm690.c
M tests/codec/codec_test.ok
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/1552/1

diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c
index c3cb932..b273f0f 100644
--- a/src/codec/gsm690.c
+++ b/src/codec/gsm690.c
@@ -215,7 +215,7 @@
 };
 
 static const uint8_t amr_len_by_ft[16] = {
-	12, 13, 15, 17, 19, 20, 26, 31, 0,  0,  0,  0,  0,  0,  0,  0
+	12, 13, 15, 17, 19, 20, 26, 31, 7,  0,  0,  0,  0,  0,  0,  0
 };
 
 const struct value_string osmo_amr_type_names[] = {
@@ -262,7 +262,7 @@
 	if (rtppayload[1] >> 7)
 		return -ENOTSUP;
 
-	if (payload_len - 2 < amr_len_by_ft[type])
+	if (payload_len < amr_len_by_ft[type])
 		return -ENOTSUP;
 
 	if (ft)
diff --git a/tests/codec/codec_test.ok b/tests/codec/codec_test.ok
index 2af7cc7..80c4a09 100644
--- a/tests/codec/codec_test.ok
+++ b/tests/codec/codec_test.ok
@@ -1,6 +1,6 @@
 AMR RTP payload decoder test:
-[2] decode RTP 20 44 00 00 00 00 04 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type FIRST	[2] encode [0]
-[2] decode RTP 20 44 29 c2 92 91 f4 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type UPDATE	[2] encode [0]
+[9] decode RTP 20 44 00 00 00 00 04 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type FIRST	[9] encode [0]
+[9] decode RTP 20 44 29 c2 92 91 f4 OK: FT AMR SID, CMR AMR 5,90 kbit/s, CMI is 2, SID type UPDATE	[9] encode [0]
 [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1
 [2/2] No Data/NA, CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1
 [33/33] AMR 12,2 kbit/s (GSM-EFR), CMR: OK, FT: OK, BFI: OK, CMI: -1, STI: -1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list