Ignore:
Timestamp:
Mar 22, 2012 3:29:56 AM (12 years ago)
Author:
nanang
Message:

Re #1467: fix sound device (opened/closed) status check in check_snd_dev_idle(), especially when sound device is managed by app (no_snd = PJ_TRUE). Note that pjsua_media_subsys_destroy() always close the sound device first, so check_snd_dev_idle() in pjsua_destroy() sequence should have been just a no-operation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r3945 r3981  
    279279    unsigned call_cnt; 
    280280 
     281    /* Check if the sound device auto-close feature is disabled. */ 
     282    if (pjsua_var.media_cfg.snd_auto_close_time < 0) 
     283        return; 
     284 
     285    /* Check if the sound device is currently closed. */ 
     286    if (!pjsua_var.snd_is_on) 
     287        return; 
     288 
    281289    /* Get the call count, we shouldn't close the sound device when there is 
    282290     * any calls active. 
     
    305313     * It is idle when there is no port connection in the bridge and 
    306314     * there is no active call. 
    307      * 
    308      * Note: this block is now valid if no snd dev is used because of #1299 
    309315     */ 
    310     if ((pjsua_var.snd_port!=NULL || pjsua_var.null_snd!=NULL || 
    311             pjsua_var.no_snd) && 
    312         pjsua_var.snd_idle_timer.id == PJ_FALSE && 
    313         pjmedia_conf_get_connect_count(pjsua_var.mconf) == 0 && 
     316    if (pjsua_var.snd_idle_timer.id == PJ_FALSE && 
    314317        call_cnt == 0 && 
    315         pjsua_var.media_cfg.snd_auto_close_time >= 0) 
     318        pjmedia_conf_get_connect_count(pjsua_var.mconf) == 0) 
    316319    { 
    317320        pj_time_val delay; 
     
    38383841    } 
    38393842 
     3843    pjsua_var.snd_is_on = PJ_TRUE; 
     3844 
    38403845    pj_log_pop_indent(); 
    38413846    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.