Changeset 5140


Ignore:
Timestamp:
Jul 31, 2015 7:12:36 AM (6 years ago)
Author:
nanang
Message:

Fix #1871: fixed missing audio index normalization in audio device open functions.

Location:
pjproject/trunk/pjmedia/src/pjmedia
Files:
2 edited

Legend:

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

    r4537 r5140  
    125125    pj_status_t status; 
    126126 
     127    /* Normalize rec_id & play_id */ 
     128    if (dir & PJMEDIA_DIR_CAPTURE && rec_id < 0) 
     129        rec_id = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; 
     130    if (dir & PJMEDIA_DIR_PLAYBACK && play_id < 0) 
     131        play_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 
     132 
    127133    /* Initialize parameters */ 
    128134    if (dir & PJMEDIA_DIR_CAPTURE) { 
  • pjproject/trunk/pjmedia/src/pjmedia/sound_port.c

    r4982 r5140  
    378378    pjmedia_snd_port_param_default(&param); 
    379379 
     380    /* Normalize rec_id & play_id */ 
     381    if (rec_id < 0) 
     382        rec_id = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; 
     383    if (play_id < 0) 
     384        play_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 
     385 
    380386    status = pjmedia_aud_dev_default_param(rec_id, &param.base); 
    381387    if (status != PJ_SUCCESS) 
     
    412418    pjmedia_snd_port_param_default(&param); 
    413419 
     420    /* Normalize dev_id */ 
     421    if (dev_id < 0) 
     422        dev_id = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; 
     423 
    414424    status = pjmedia_aud_dev_default_param(dev_id, &param.base); 
    415425    if (status != PJ_SUCCESS) 
     
    445455 
    446456    pjmedia_snd_port_param_default(&param); 
     457 
     458    /* Normalize dev_id */ 
     459    if (dev_id < 0) 
     460        dev_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 
    447461 
    448462    status = pjmedia_aud_dev_default_param(dev_id, &param.base); 
Note: See TracChangeset for help on using the changeset viewer.