diff options
Diffstat (limited to 'src/osmo-bsc/codec_pref.c')
-rw-r--r-- | src/osmo-bsc/codec_pref.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index a94d6a834..659853ce8 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -281,6 +281,7 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, { unsigned int i; uint8_t perm_spch; + bool full_rate; bool match = false; const struct gsm0808_speech_codec *sc_match = NULL; uint16_t amr_s15_s0_supported; @@ -295,15 +296,16 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, perm_spch = audio_support_to_gsm88(msc->audio_support[i]); /* Determine if the result is a half or full rate codec */ - rc = full_rate_from_perm_spch(&ch_mode_rate->full_rate, perm_spch); + rc = full_rate_from_perm_spch(&full_rate, perm_spch); if (rc < 0) return -EINVAL; + ch_mode_rate->chan_rate = full_rate ? CH_RATE_FULL : CH_RATE_HALF; /* If we have a preference for FR or HR in our request, we * discard the potential match */ - if (rate_pref == RATE_PREF_HR && ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_HR && ch_mode_rate->chan_rate == CH_RATE_FULL) continue; - if (rate_pref == RATE_PREF_FR && !ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_FR && ch_mode_rate->chan_rate == CH_RATE_HALF) continue; /* Check this permitted speech value against the BTS specific parameters. @@ -321,8 +323,8 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, /* Exit without result, in case no match can be deteched */ if (!match) { - ch_mode_rate->full_rate = false; ch_mode_rate->chan_mode = GSM48_CMODE_SIGN; + ch_mode_rate->chan_rate = CH_RATE_SDCCH; ch_mode_rate->s15_s0 = 0; return -1; } |