From 1cfcdc76c6bc8bdbeb2454beea46d5f1c7d143b3 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 7 Oct 2015 03:57:17 +0000 Subject: 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 --- pjmedia/src/pjmedia-codec/ilbc.c | 2 +- pjmedia/src/pjmedia/stream.c | 5 ++++- 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); -- cgit v1.2.3