Index: /pjproject/trunk/pjmedia/src/pjmedia-videodev/android_opengl.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-videodev/android_opengl.c	(revision 6137)
+++ /pjproject/trunk/pjmedia/src/pjmedia-videodev/android_opengl.c	(revision 6138)
@@ -474,4 +474,10 @@
     pj_status_t status;
 
+    /* Video conference just trying to send heart beat for updating timestamp
+     * or keep-alive, this port doesn't need any, just ignore.
+     */
+    if (frame->size==0 || frame->buf==NULL)
+	return PJ_SUCCESS;
+	
     if (!stream->is_running || stream->display == EGL_NO_DISPLAY)
 	return PJ_EINVALIDOP;
Index: /pjproject/trunk/pjmedia/src/pjmedia-videodev/darwin_dev.m
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-videodev/darwin_dev.m	(revision 6137)
+++ /pjproject/trunk/pjmedia/src/pjmedia-videodev/darwin_dev.m	(revision 6138)
@@ -1331,4 +1331,10 @@
     struct darwin_stream *stream = (struct darwin_stream*)strm;
 
+    /* Video conference just trying to send heart beat for updating timestamp
+     * or keep-alive, this port doesn't need any, just ignore.
+     */
+    if (frame->size==0 || frame->buf==NULL)
+	return PJ_SUCCESS;
+	
     if (stream->frame_size >= frame->size)
         pj_memcpy(stream->render_buf, frame->buf, frame->size);
Index: /pjproject/trunk/pjmedia/src/pjmedia-videodev/ios_opengl_dev.m
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-videodev/ios_opengl_dev.m	(revision 6137)
+++ /pjproject/trunk/pjmedia/src/pjmedia-videodev/ios_opengl_dev.m	(revision 6138)
@@ -472,4 +472,10 @@
     struct iosgl_stream *stream = (struct iosgl_stream*)strm;
     
+    /* Video conference just trying to send heart beat for updating timestamp
+     * or keep-alive, this port doesn't need any, just ignore.
+     */
+    if (frame->size==0 || frame->buf==NULL)
+	return PJ_SUCCESS;
+	
     if (!stream->is_running)
 	return PJ_EINVALIDOP;
Index: /pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 6137)
+++ /pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 6138)
@@ -926,10 +926,15 @@
     stream->last_ts.u64 = frame->timestamp.u64;
 
+    /* Video conference just trying to send heart beat for updating timestamp
+     * or keep-alive, this port doesn't need any, just ignore.
+     */
+    if (frame->size==0 || frame->buf==NULL)
+	return PJ_SUCCESS;
+
+    if (frame->size < stream->vafp.framebytes)
+	return PJ_ETOOSMALL;
+
     if (!stream->is_running)
 	return PJ_EINVALIDOP;
-
-    if (frame->size==0 || frame->buf==NULL ||
-	frame->size < stream->vafp.framebytes)
-	return PJ_SUCCESS;
 
     stream->frame = frame;
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 6137)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 6138)
@@ -668,4 +668,11 @@
 	    }
 
+	    status = pjsua_vid_conf_connect(w->cap_slot, w->rend_slot, NULL);
+	    if (status != PJ_SUCCESS) {
+		PJ_PERROR(4, (THIS_FILE, status,
+			      "Ignored error on connecting video ports "
+			      "on wid=%d", wid));
+	    }
+
 	    /* Done */
 	    *id = wid;
@@ -821,5 +828,5 @@
 
 	/* For preview window, connect capturer & renderer (via conf) */
-	if (w->type == PJSUA_WND_TYPE_PREVIEW) {
+	if (w->type == PJSUA_WND_TYPE_PREVIEW && show) {
 	    status = pjsua_vid_conf_connect(w->cap_slot, w->rend_slot, NULL);
 	    if (status != PJ_SUCCESS)
@@ -1445,4 +1452,10 @@
 			    &enabled);
 	} else {
+	    status = pjsua_vid_conf_disconnect(w->cap_slot, w->rend_slot);
+	    if (status != PJ_SUCCESS) {
+		PJ_PERROR(4, (THIS_FILE, status,
+			      "Ignored error on disconnecting video ports "
+			      "on stopping preview wid=%d", wid));
+	    }
 	    status = pjmedia_vid_port_stop(w->vp_rend);
 	}
