diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-09-09 23:29:27 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-09-09 23:29:27 +0200 |
commit | 06636b61559b5be5290315b81f2af08cce475548 (patch) | |
tree | abf2355f44756c68499c53b455d1590d78a8c36a /src/common/amr.c | |
parent | 9508fb80a4c8284daf52b1beb154a86df7d5ee07 (diff) |
AMR: change definition of amr_get_initial_mode() return value
AMR: return AMR_CODEC_MODE (0..3) instead of full range
Diffstat (limited to 'src/common/amr.c')
-rw-r--r-- | src/common/amr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/amr.c b/src/common/amr.c index eeb6e7f2..4a79b69f 100644 --- a/src/common/amr.c +++ b/src/common/amr.c @@ -89,27 +89,29 @@ ret_einval: } +/*! \brief determine AMR initial codec mode for given logical channel + * \returns integer between 0..3 for AMR codce mode 1..4 */ unsigned int amr_get_initial_mode(struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; if (lchan->mr_conf.icmi) { /* initial mode given, coding in TS 05.09 3.4.1 */ - return amr_mrc->mode[lchan->mr_conf.smod].mode; + return lchan->mr_conf.smod; } else { /* implicit rule according to TS 05.09 Chapter 3.4.3 */ switch (amr_mrc->num_modes) { case 2: case 3: /* return the most robust */ - return amr_mrc->mode[0].mode; + return 0; case 4: /* return the second-most robust */ - return amr_mrc->mode[1].mode; + return 1; case 1: default: /* return the only mode we have */ - return amr_mrc->mode[0].mode; + return 0; } } } |