aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2013-02-12 19:22:45 +0100
committerPablo Neira Ayuso <pablo@gnumonks.org>2013-02-12 19:29:42 +0100
commit92601d0a20990209c085723d94bf7d636fa9186d (patch)
tree22038afa1f88cd1858748fd3d2f8e29b52cd0679 /src
parentc92810eccd491b9dfc7b1c2bb4dbc599ff04e9fe (diff)
osmux: use ft instead of the cmr
The cmr is the requested codec for the other peer, the ft actually contains the current codec mode. cmr may contain 15 which means "don't care".
Diffstat (limited to 'src')
-rw-r--r--src/amr.c22
-rw-r--r--src/osmux.c8
2 files changed, 15 insertions, 15 deletions
diff --git a/src/amr.c b/src/amr.c
index b52acc3..0a58b57 100644
--- a/src/amr.c
+++ b/src/amr.c
@@ -25,18 +25,18 @@
* 7 12.20 244 31
*/
-static size_t amr_cmr_to_bytes[AMR_CMR_MAX] = {
- [AMR_CMR_0] = 12,
- [AMR_CMR_1] = 13,
- [AMR_CMR_2] = 15,
- [AMR_CMR_3] = 17,
- [AMR_CMR_4] = 19,
- [AMR_CMR_5] = 20,
- [AMR_CMR_6] = 26,
- [AMR_CMR_7] = 31,
+static size_t amr_ft_to_bytes[AMR_FT_MAX] = {
+ [AMR_FT_0] = 12,
+ [AMR_FT_1] = 13,
+ [AMR_FT_2] = 15,
+ [AMR_FT_3] = 17,
+ [AMR_FT_4] = 19,
+ [AMR_FT_5] = 20,
+ [AMR_FT_6] = 26,
+ [AMR_FT_7] = 31,
};
-size_t osmo_amr_bytes(uint8_t amr_cmr)
+size_t osmo_amr_bytes(uint8_t amr_ft)
{
- return amr_cmr_to_bytes[amr_cmr];
+ return amr_ft_to_bytes[amr_ft];
}
diff --git a/src/osmux.c b/src/osmux.c
index 2775bfa..c42ec2f 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -40,7 +40,7 @@ struct osmux_hdr *osmux_xfrm_output_pull(struct msgb *msg)
osmuxh = (struct osmux_hdr *)msg->data;
msgb_pull(msg, sizeof(struct osmux_hdr) +
- (osmo_amr_bytes(osmuxh->amr_cmr) * (osmuxh->ctr+1)));
+ (osmo_amr_bytes(osmuxh->amr_ft) * (osmuxh->ctr+1)));
} else if (msg->len > 0) {
LOGP(DLMIB, LOGL_ERROR,
"remaining %d bytes, broken osmuxhdr?\n", msg->len);
@@ -61,7 +61,7 @@ osmux_rebuild_rtp(struct osmux_out_handle *h,
out_msg = msgb_alloc(sizeof(struct rtp_hdr) +
sizeof(struct amr_hdr) +
- osmo_amr_bytes(osmuxh->amr_cmr),
+ osmo_amr_bytes(osmuxh->amr_ft),
"OSMUX test");
if (out_msg == NULL)
return NULL;
@@ -116,8 +116,8 @@ int osmux_xfrm_output(struct osmux_hdr *osmuxh, struct osmux_out_handle *h,
msg = osmux_rebuild_rtp(h, osmuxh,
osmux_get_payload(osmuxh) +
- i * osmo_amr_bytes(osmuxh->amr_cmr),
- osmo_amr_bytes(osmuxh->amr_cmr));
+ i * osmo_amr_bytes(osmuxh->amr_ft),
+ osmo_amr_bytes(osmuxh->amr_ft));
if (msg == NULL)
continue;