summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-10-07 03:57:17 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-10-07 03:57:17 +0000
commit1cfcdc76c6bc8bdbeb2454beea46d5f1c7d143b3 (patch)
tree81a8657f96f4717682ae20d0f7b66776b8e6fb06
parente5906b82cd39fc0e4f6ab7e0138e6e81da7ab8ef (diff)
Re #1882 (misc): Fixed possibly incorrect stream stats
When a codec is opened, it can modify its param (such as iLBC can normalize its frame ptime based on remote SDP), so the stream stats has to be updated accordingly. Also in this fix is to increase the log level which shows the info of iLBC mode opened. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5187 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia-codec/ilbc.c2
-rw-r--r--pjmedia/src/pjmedia/stream.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia-codec/ilbc.c b/pjmedia/src/pjmedia-codec/ilbc.c
index 7e780249..50b2220c 100644
--- a/pjmedia/src/pjmedia-codec/ilbc.c
+++ b/pjmedia/src/pjmedia-codec/ilbc.c
@@ -527,7 +527,7 @@ static pj_status_t ilbc_codec_open(pjmedia_codec *codec,
*/
pj_set_timestamp32(&ilbc_codec->last_tx, 0, 0);
- PJ_LOG(5,(ilbc_codec->obj_name,
+ PJ_LOG(4,(ilbc_codec->obj_name,
"iLBC codec opened, mode=%d", dec_fmtp_mode));
return PJ_SUCCESS;
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c
index 7ef6d08e..e4618541 100644
--- a/pjmedia/src/pjmedia/stream.c
+++ b/pjmedia/src/pjmedia/stream.c
@@ -2081,7 +2081,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt,
/* Get codec param: */
if (info->param)
- stream->codec_param = *info->param;
+ stream->codec_param = *stream->si.param;
else {
status = pjmedia_codec_mgr_get_default_param(stream->codec_mgr,
&info->fmt,
@@ -2385,6 +2385,9 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt,
}
#endif
+ /* Update the stream info's codec param */
+ stream->si.param = &stream->codec_param;
+
/* Send RTCP SDES */
if (!stream->rtcp_sdes_bye_disabled) {
pjmedia_stream_send_rtcp_sdes(stream);