summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2016-12-23 05:40:59 +0000
committerNanang Izzuddin <nanang@teluu.com>2016-12-23 05:40:59 +0000
commitfc96eeb1372567d614304f915b8221c9568d4651 (patch)
tree9f9c6a2890d575baba88b581ec32f07d5c199989
parent11e0dc9637cefc3c4dcb837246b9d9c3748e3e7e (diff)
Fixed #1987: Verify 'med_prov_cnt' after media reinitialization (with a new call setting) to make sure it is not decreased.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5510 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 68d466ff..641e2b10 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -2040,6 +2040,17 @@ pj_status_t pjsua_media_channel_init(pjsua_call_id call_id,
}
#endif
}
+
+ /* In case of media reinit, 'med_prov_cnt' may be decreased
+ * because the new call->opt says so. As media count should
+ * never decrease, we should verify 'med_prov_cnt' to be
+ * at least equal to 'med_cnt' (see also #1987).
+ */
+ if (reinit && (call->opt.flag & PJSUA_CALL_REINIT_MEDIA) &&
+ call->med_prov_cnt < call->med_cnt)
+ {
+ call->med_prov_cnt = call->med_cnt;
+ }
}
call->rem_offerer = PJ_FALSE;