Ignore:
Timestamp:
Apr 24, 2012 10:26:07 AM (8 years ago)
Author:
ming
Message:

Fixed #1494: Use EC options to determine whether to use device/software EC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia/sound_port.c

    r4065 r4079  
    226226    if (param_copy.flags & PJMEDIA_AUD_DEV_CAP_EC) { 
    227227        /* EC is wanted */ 
    228         if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 
     228        if ((snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) == 0 && 
     229            snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) 
     230        { 
    229231            /* Device supports EC */ 
    230232            /* Nothing to do */ 
    231233        } else { 
    232             /* Device doesn't support EC, remove EC settings from 
     234            /* Application wants to use software EC or device 
     235             * doesn't support EC, remove EC settings from 
    233236             * device parameters 
    234237             */ 
     
    262265                                  snd_port->samples_per_frame); 
    263266 
    264     /* Create software EC if parameter specifies EC but device  
    265      * doesn't support EC. Only do this if the format is PCM! 
     267    /* Create software EC if parameter specifies EC and 
     268     * (app specifically requests software EC or device 
     269     * doesn't support EC). Only do this if the format is PCM! 
    266270     */ 
    267271    if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC) && 
    268         (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 && 
     272        ((snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 || 
     273         (snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) != 0) && 
    269274        param_copy.ext_fmt.id == PJMEDIA_FORMAT_PCM) 
    270275    { 
     
    506511 
    507512    /* Determine whether we use device or software EC */ 
    508     if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 
     513    if ((snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) == 0 && 
     514        snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) 
     515    { 
    509516        /* We use device EC */ 
    510517        pj_bool_t ec_enabled; 
Note: See TracChangeset for help on using the changeset viewer.