You have introduced a function for copying frames (pjmedia_frame_copy) but in in line 1247 in vid_port.c you still us pj_memcpy instead of pjmedia_frame_copy: if (!vp->conv.conv) pj_memcpy(frame, vp->frm_buf, sizeof(*frame)); } You might also want to use the mutex there as well (pj_mutex_lock(vp->frm_mutex); as in get_frame_from_buffer)?