summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2011-10-06 06:05:36 +0000
committerBenny Prijono <bennylp@teluu.com>2011-10-06 06:05:36 +0000
commit2c94f2039da8773c2693dc41f47accecfaad3106 (patch)
treef56fa75c1cac8a6053c7015cb0c545a8fdb25714
parentc0e5a0354e56c48492e50edbdb1d82c2dc25b77f (diff)
Misc (re #1370): calling pjmedia_vid_port_start() more than once had caused freezing capture video if preview is enabled before making video calls
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3793 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_vid.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_vid.c b/pjsip/src/pjsua-lib/pjsua_vid.c
index 4d3f77cc..ac47a8f3 100644
--- a/pjsip/src/pjsua-lib/pjsua_vid.c
+++ b/pjsip/src/pjsua-lib/pjsua_vid.c
@@ -827,6 +827,7 @@ pj_status_t video_channel_update(pjsua_call_media *call_med,
{
pjsua_vid_win *w;
pjsua_vid_win_id wid;
+ pj_bool_t just_created = PJ_FALSE;
PJ_LOG(4,(THIS_FILE, "Setting up TX.."));
pj_log_push_indent();
@@ -859,6 +860,7 @@ pj_status_t video_channel_update(pjsua_call_media *call_med,
pj_log_pop_indent();
return status;
}
+ just_created = PJ_TRUE;
}
w = &pjsua_var.win[wid];
@@ -883,10 +885,12 @@ pj_status_t video_channel_update(pjsua_call_media *call_med,
}
/* Start capturer */
- status = pjmedia_vid_port_start(w->vp_cap);
- if (status != PJ_SUCCESS) {
- pj_log_pop_indent();
- goto on_error;
+ if (just_created) {
+ status = pjmedia_vid_port_start(w->vp_cap);
+ if (status != PJ_SUCCESS) {
+ pj_log_pop_indent();
+ goto on_error;
+ }
}
/* Done */