summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-02-17 17:31:19 +0000
committerBenny Prijono <bennylp@teluu.com>2010-02-17 17:31:19 +0000
commit62db1feb6e87c6b7bef6a91be0f5d3859f9c0ea0 (patch)
tree79b00d6e82013ac518a4692d5890c46dcb40980b /pjmedia
parentdf53d8b122ceb11094c3b8f00f327746d81166f9 (diff)
More ticket #1028: fixed compile error caused by corrupted version of passthrough.c when re-commiting r3074 (in r3078). (note: this changeset was originally done by nanang, recheckedin due to moving svn repository)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3100 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia-codec/passthrough.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/pjmedia/src/pjmedia-codec/passthrough.c b/pjmedia/src/pjmedia-codec/passthrough.c
index bcd8f81a..9dffcdf7 100644
--- a/pjmedia/src/pjmedia-codec/passthrough.c
+++ b/pjmedia/src/pjmedia-codec/passthrough.c
@@ -681,13 +681,18 @@ static pj_status_t codec_open( pjmedia_codec *codec,
if (desc->pt == PJMEDIA_RTP_PT_AMR || desc->pt == PJMEDIA_RTP_PT_AMRWB) {
amr_settings_t *s;
pj_uint8_t octet_align = 0;
- const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11};
+ pj_int8_t enc_mode;
+
+ enc_mode = pjmedia_codec_amr_get_mode(attr->info.avg_bps);
+ pj_assert(enc_mode >= 0 && enc_mode <= 8);
- /* Fetch octet-align setting. It should be fine to fetch only
- * the decoder, since encoder & decoder must use the same setting
- * (RFC 4867 section 8.3.1).
- */
for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) {
+ const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11};
+
+ /* Fetch octet-align setting. It should be fine to fetch only
+ * the decoder, since encoder & decoder must use the same setting
+ * (RFC 4867 section 8.3.1).
+ */
if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name,
&STR_FMTP_OCTET_ALIGN) == 0)
{
@@ -698,6 +703,8 @@ static pj_status_t codec_open( pjmedia_codec *codec,
}
for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) {
+ const pj_str_t STR_FMTP_MODE_SET = {"mode-set", 8};
+
/* mode-set, encoding mode is chosen based on local default mode
* setting:
* - if local default mode is included in the mode-set, use it
@@ -706,8 +713,6 @@ static pj_status_t codec_open( pjmedia_codec *codec,
* one, e.g: local default mode is 4, the mode-set param
* contains '2,3,5,6', then 5 will be chosen.
*/
- const pj_str_t STR_FMTP_MODE_SET = {"mode-set", 8};
-
if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name,
&STR_FMTP_MODE_SET) == 0)
{
@@ -762,6 +767,11 @@ static pj_status_t codec_open( pjmedia_codec *codec,
s->dec_setting.reorder = PJ_FALSE; /* Note this! passthrough codec
doesn't do sensitivity bits
reordering */
+
+ /* Return back bitrate info to application */
+ attr->info.avg_bps = s->enc_setting.amr_nb?
+ pjmedia_codec_amrnb_bitrates[s->enc_mode]:
+ pjmedia_codec_amrwb_bitrates[s->enc_mode];
}
#endif