Changeset 3744


Ignore:
Timestamp:
Sep 8, 2011 5:43:54 AM (8 years ago)
Author:
nanang
Message:

Fixed #1365: Applied volume setting (input & output) when the MDA audio device is started.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp

    r3553 r3744  
    406406    } 
    407407 
     408    /* Apply output volume setting if specified */ 
     409    if (parentStrm_->param.flags &  
     410        PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING)  
     411    { 
     412        stream_set_cap(&parentStrm_->base, 
     413                       PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING,  
     414                       &parentStrm_->param.input_vol); 
     415    } 
     416 
    408417    // set stream priority to normal and time sensitive 
    409418    iInputStream_->SetPriority(EPriorityNormal,  
     
    684693                                            iSettings.iChannels); 
    685694 
    686         // set volume to 1/2th of stream max volume 
    687         iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2); 
     695        /* Apply output volume setting if specified */ 
     696        if (parentStrm_->param.flags &  
     697            PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING)  
     698        { 
     699            stream_set_cap(&parentStrm_->base, 
     700                           PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING,  
     701                           &parentStrm_->param.output_vol); 
     702        } else { 
     703            // set volume to 1/2th of stream max volume 
     704            iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2); 
     705        } 
    688706         
    689707        // set stream priority to normal and time sensitive 
     
    10351053        break; 
    10361054    case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: 
    1037         if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { 
     1055        if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { 
    10381056            PJ_ASSERT_RETURN(strm->out_engine, PJ_EINVAL); 
    10391057             
Note: See TracChangeset for help on using the changeset viewer.