Ignore:
Timestamp:
Oct 27, 2017 6:30:50 AM (7 years ago)
Author:
ming
Message:

Fixed #2053: Update pjsua_get_snd_dev() info before calling on_snd_dev_operation() callback

File:
1 edited

Legend:

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

    r5676 r5677  
    2424 
    2525#define THIS_FILE               "pjsua_aud.c" 
    26 #define NULL_SND_DEV_ID         -99 
    2726 
    2827/***************************************************************************** 
     
    881880 
    882881        if (need_reopen) { 
    883             if (pjsua_var.cap_dev != NULL_SND_DEV_ID) { 
     882            if (pjsua_var.cap_dev != PJSUA_SND_NULL_DEV) { 
    884883                pjmedia_snd_port_param param; 
    885884 
     
    17281727 
    17291728    /* Check if NULL sound device is used */ 
    1730     if (NULL_SND_DEV_ID==param->base.rec_id || 
    1731         NULL_SND_DEV_ID==param->base.play_id) 
     1729    if (PJSUA_SND_NULL_DEV==param->base.rec_id || 
     1730        PJSUA_SND_NULL_DEV==param->base.play_id) 
    17321731    { 
    17331732        return pjsua_set_null_snd_dev(); 
     
    17361735    /* Close existing sound port */ 
    17371736    close_snd_dev(); 
     1737 
     1738    /* Save the device IDs */ 
     1739    pjsua_var.cap_dev = param->base.rec_id; 
     1740    pjsua_var.play_dev = param->base.play_id; 
    17381741 
    17391742    /* Notify app */ 
     
    18531856    } 
    18541857 
    1855     /* Save the device IDs */ 
    1856     pjsua_var.cap_dev = param->base.rec_id; 
    1857     pjsua_var.play_dev = param->base.play_id; 
    1858  
    18591858    /* Update sound device name. */ 
    18601859    { 
     
    20102009     
    20112010    /* Null-sound */ 
    2012     if (snd_param->capture_dev == NULL_SND_DEV_ID &&  
    2013         snd_param->playback_dev == NULL_SND_DEV_ID)  
     2011    if (snd_param->capture_dev == PJSUA_SND_NULL_DEV &&  
     2012        snd_param->playback_dev == PJSUA_SND_NULL_DEV)  
    20142013    { 
    20152014        PJSUA_UNLOCK(); 
     
    21302129    close_snd_dev(); 
    21312130 
     2131    pjsua_var.cap_dev = PJSUA_SND_NULL_DEV; 
     2132    pjsua_var.play_dev = PJSUA_SND_NULL_DEV; 
     2133 
    21322134    /* Notify app */ 
    21332135    if (pjsua_var.ua_cfg.cb.on_snd_dev_operation) { 
     
    21622164    PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 
    21632165 
    2164     pjsua_var.cap_dev = NULL_SND_DEV_ID; 
    2165     pjsua_var.play_dev = NULL_SND_DEV_ID; 
    2166  
    21672166    pjsua_var.no_snd = PJ_FALSE; 
    21682167    pjsua_var.snd_is_on = PJ_TRUE; 
     
    21852184    close_snd_dev(); 
    21862185    pjsua_var.no_snd = PJ_TRUE; 
     2186    pjsua_var.cap_dev = PJSUA_SND_NO_DEV; 
     2187    pjsua_var.play_dev = PJSUA_SND_NO_DEV; 
    21872188 
    21882189    PJSUA_UNLOCK(); 
Note: See TracChangeset for help on using the changeset viewer.