Changeset 5012


Ignore:
Timestamp:
Mar 22, 2015 7:50:28 AM (9 years ago)
Author:
ming
Message:

Fixed #1827: Video port's clock thread may get stuck during format change event

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/os.h

    r4760 r5012  
    312312/** 
    313313 * Join thread, and block the caller thread until the specified thread exits. 
     314 * If it is called from within the thread itself, it will return immediately 
     315 * with failure status. 
    314316 * If the specified thread has already been dead, or it does not exist, 
    315  * the function will return immediately with successfull status. 
     317 * the function will return immediately with successful status. 
    316318 * 
    317319 * @param thread    The thread handle. 
  • pjproject/trunk/pjlib/src/pj/os_core_unix.c

    r4990 r5012  
    717717 
    718718    PJ_CHECK_STACK(); 
     719 
     720    if (p == pj_thread_this()) 
     721        return PJ_ECANCELLED; 
    719722 
    720723    PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name)); 
  • pjproject/trunk/pjmedia/src/pjmedia/vid_port.c

    r4290 r5012  
    581581        pj_status_t status; 
    582582         
    583         pjmedia_vid_port_stop(vp); 
     583        /* Ticket #1827: 
     584         * Stopping video port should not be necessary here because 
     585         * it will also try to stop the clock, from inside the clock's 
     586         * own thread, so it may get stuck. We just stop the video device 
     587         * stream instead. 
     588         * pjmedia_vid_port_stop(vp); 
     589         */ 
     590        pjmedia_vid_dev_stream_stop(vp->strm); 
    584591         
    585592        /* Retrieve the video format detail */ 
     
    636643        } 
    637644         
    638         pjmedia_vid_port_start(vp); 
     645        /* pjmedia_vid_port_start(vp); */ 
     646        pjmedia_vid_dev_stream_start(vp->strm); 
    639647    } 
    640648     
Note: See TracChangeset for help on using the changeset viewer.