Changeset 5571 for pjproject


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

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

Location:
pjproject/trunk
Files:
2 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]", 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r5562 r5571  
    25502550static void stop_media_stream(pjsua_call *call, unsigned med_idx) 
    25512551{ 
    2552     pjsua_call_media *call_med = &call->media[med_idx]; 
    2553  
    2554     /* Check if stream does not exist */ 
    2555     if (med_idx >= call->med_cnt) 
    2556         return; 
     2552    pjsua_call_media *call_med; 
     2553     
     2554    if (pjsua_call_media_is_changing(call)) { 
     2555        call_med = &call->media_prov[med_idx]; 
     2556        if (med_idx >= call->med_prov_cnt) 
     2557            return; 
     2558    } else { 
     2559        call_med = &call->media[med_idx]; 
     2560        if (med_idx >= call->med_cnt) 
     2561            return; 
     2562    } 
    25572563 
    25582564    pj_log_push_indent(); 
Note: See TracChangeset for help on using the changeset viewer.