Ignore:
Timestamp:
Mar 24, 2017 3:00:47 AM (4 years ago)
Author:
ming
Message:

Fixed #2005: Crash when hanging up call if video capture device fails to open

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_port.c

    r5149 r5571  
    505505    PJ_ASSERT_RETURN(vfd->fps.num, PJ_EINVAL); 
    506506 
     507    /* Get device info */ 
     508    if (prm->vidparam.dir & PJMEDIA_DIR_CAPTURE) 
     509        status = pjmedia_vid_dev_get_info(prm->vidparam.cap_id, &di); 
     510    else 
     511        status = pjmedia_vid_dev_get_info(prm->vidparam.rend_id, &di); 
     512    if (status != PJ_SUCCESS) 
     513        return status; 
     514 
    507515    /* Allocate videoport */ 
    508516    vp = PJ_POOL_ZALLOC_T(pool, pjmedia_vid_port); 
     
    514522    vparam = prm->vidparam; 
    515523    dev_name[0] = '\0'; 
    516  
    517     /* Get device info */ 
    518     if (vp->dir & PJMEDIA_DIR_CAPTURE) 
    519         status = pjmedia_vid_dev_get_info(prm->vidparam.cap_id, &di); 
    520     else 
    521         status = pjmedia_vid_dev_get_info(prm->vidparam.rend_id, &di); 
    522     if (status != PJ_SUCCESS) 
    523         return status; 
    524524 
    525525    pj_ansi_snprintf(dev_name, sizeof(dev_name), "%s [%s]", 
Note: See TracChangeset for help on using the changeset viewer.