Changeset 5955 for pjproject


Ignore:
Timestamp:
Mar 20, 2019 3:23:34 AM (6 years ago)
Author:
nanang
Message:

Fix #2184: PJSUA2 cannot switch from null audio device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/media.cpp

    r5923 r5955  
    697697    param.capture_dev = capture_dev; 
    698698    param.playback_dev = getPlaybackDev(); 
    699     if (param.playback_dev == PJMEDIA_AUD_INVALID_DEV) 
     699     
     700    /* Normalize invalid ID or null device to default device */ 
     701    if (param.playback_dev == PJMEDIA_AUD_INVALID_DEV || 
     702        param.playback_dev == PJSUA_SND_NULL_DEV) 
     703    { 
    700704        param.playback_dev = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 
     705    } 
    701706 
    702707    param.mode = PJSUA_SND_DEV_NO_IMMEDIATE_OPEN;     
     
    710715    pjsua_snd_dev_param_default(&param);     
    711716 
     717    param.playback_dev = playback_dev; 
    712718    param.capture_dev = getCaptureDev(); 
    713     if (param.capture_dev == PJMEDIA_AUD_INVALID_DEV) 
     719 
     720    /* Normalize invalid ID or null device to default device */ 
     721    if (param.capture_dev == PJMEDIA_AUD_INVALID_DEV || 
     722        param.capture_dev == PJSUA_SND_NULL_DEV) 
     723    { 
    714724        param.capture_dev = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; 
    715     param.playback_dev = playback_dev; 
     725    } 
    716726 
    717727    param.mode = PJSUA_SND_DEV_NO_IMMEDIATE_OPEN;     
Note: See TracChangeset for help on using the changeset viewer.