DTX: fix AMR SID-FIRST detection

Max's note: adjusted test output.

Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc
Related: OS#1801
This commit is contained in:
Jean-Francois Dionne 2017-01-10 10:23:56 +01:00 committed by Harald Welte
parent 85908a9c2f
commit d02c8af6cc
2 changed files with 4 additions and 4 deletions

View File

@ -215,7 +215,7 @@ const uint16_t gsm690_4_75_bitorder[95] = {
};
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 @@ int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr,
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)

View File

@ -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