Index: /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_port.h
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_port.h	(revision 3630)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_port.h	(revision 3631)
@@ -142,11 +142,9 @@
  *
  * @param vid_port  The video port.
- * @param dir       Video port's direction.
  *
  * @return	    The clock source.
  */
 PJ_DECL(pjmedia_clock_src *)
-pjmedia_vid_port_get_clock_src( pjmedia_vid_port *vid_port,
-                                pjmedia_dir dir );
+pjmedia_vid_port_get_clock_src( pjmedia_vid_port *vid_port );
 
 /**
@@ -154,5 +152,4 @@
  *
  * @param vid_port  The video port.
- * @param dir       Video port's direction.
  * @param clocksrc  The clock source.
  *
@@ -161,5 +158,4 @@
 PJ_DECL(pj_status_t)
 pjmedia_vid_port_set_clock_src( pjmedia_vid_port *vid_port,
-                                pjmedia_dir dir,
                                 pjmedia_clock_src *clocksrc );
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c	(revision 3630)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c	(revision 3631)
@@ -390,6 +390,5 @@
 
 PJ_DEF(pjmedia_clock_src *)
-pjmedia_vid_port_get_clock_src( pjmedia_vid_port *vid_port,
-                                pjmedia_dir dir )
+pjmedia_vid_port_get_clock_src( pjmedia_vid_port *vid_port )
 {
     PJ_ASSERT_RETURN(vid_port, NULL);
@@ -399,5 +398,4 @@
 PJ_DECL(pj_status_t)
 pjmedia_vid_port_set_clock_src( pjmedia_vid_port *vid_port,
-                                pjmedia_dir dir,
                                 pjmedia_clock_src *clocksrc)
 {
@@ -505,8 +503,4 @@
     PJ_LOG(4,(THIS_FILE, "Closing %s..", vp->dev_name.ptr));
 
-    if (vp->conv) {
-        pjmedia_converter_destroy(vp->conv);
-        vp->conv = NULL;
-    }
     if (vp->clock) {
 	pjmedia_clock_destroy(vp->clock);
@@ -525,4 +519,8 @@
 	pj_mutex_destroy(vp->frm_mutex);
 	vp->frm_mutex = NULL;
+    }
+    if (vp->conv) {
+        pjmedia_converter_destroy(vp->conv);
+        vp->conv = NULL;
     }
     pj_pool_release(vp->pool);
@@ -723,5 +721,6 @@
         return;
     
-    status = pjmedia_vid_dev_stream_put_frame(vp->strm, &frame);
+    if (frame.size > 0)
+	status = pjmedia_vid_dev_stream_put_frame(vp->strm, &frame);
 }
 
@@ -742,5 +741,5 @@
         if (vp->client_port)
 	    status = pjmedia_port_put_frame(vp->client_port, 
-                                          (vp->conv? &frame_: frame));
+                                            (vp->conv? &frame_: frame));
         if (status != PJ_SUCCESS)
             return status;
@@ -767,4 +766,5 @@
     pj_status_t status = PJ_SUCCESS;
     
+    pj_bzero(frame, sizeof(pjmedia_frame));
     if (vp->role==ROLE_ACTIVE) {
         unsigned frame_ts = vp->clocksrc.clock_rate / 1000 *
@@ -877,7 +877,10 @@
         pjmedia_clock_src_update(&vp->clocksrc, NULL);
 
-        frame = vp->frm_buf;
-        if (convert_frame(vp, vp->frm_buf, frame) != PJ_SUCCESS)
+        status = convert_frame(vp, vp->frm_buf, frame);
+	if (status != PJ_SUCCESS)
             return status;
+
+	if (!vp->conv)
+	    pj_memcpy(frame, vp->frm_buf, sizeof(*frame));
     } else {
         /* The stream is active while we are passive so we need to get the
Index: /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c	(revision 3630)
+++ /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c	(revision 3631)
@@ -407,5 +407,5 @@
             /* Synchronize video rendering and audio playback */
             pjmedia_vid_port_set_clock_src(
-                renderer, PJMEDIA_DIR_RENDER,
+                renderer,
                 pjmedia_snd_port_get_clock_src(
                     snd_port, PJMEDIA_DIR_PLAYBACK));
