Changeset 2496


Ignore:
Timestamp:
Mar 10, 2009 12:07:51 PM (16 years ago)
Author:
bennylp
Message:

Bug fixes from last changes:

  • close sound device after opening it in pjsua_aud_set_setting()
  • bug in aud_svmask checking
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjsip/src/pjsua-lib/pjsua_media.c

    r2493 r2496  
    27212721                                           pj_bool_t keep) 
    27222722{ 
     2723    pj_status_t status; 
     2724 
    27232725    /* Check if we are allowed to set the cap */ 
    2724     if (cap & pjsua_var.aud_svmask) { 
     2726    if ((cap & pjsua_var.aud_svmask) == 0) { 
    27252727        return PJMEDIA_EAUD_INVCAP; 
    27262728    } 
    27272729 
    2728     if (keep) { 
    2729         /* Save in internal param for later device open */ 
    2730         pj_status_t status; 
    2731  
    2732         status = pjmedia_aud_param_set_cap(&pjsua_var.aud_param, 
    2733                                            cap, pval); 
    2734         if (status != PJ_SUCCESS) 
    2735             return status; 
    2736     } 
    2737  
     2730    /* If sound is active, set it immediately */ 
    27382731    if (pjsua_snd_is_active()) { 
    2739         /* Sound is active, set it immediately */ 
    27402732        pjmedia_aud_stream *strm; 
    27412733         
    27422734        strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 
    2743         return pjmedia_aud_stream_set_cap(strm, cap, pval); 
     2735        status = pjmedia_aud_stream_set_cap(strm, cap, pval); 
    27442736    } else { 
    2745         return PJ_SUCCESS; 
    2746     } 
     2737        status = PJ_SUCCESS; 
     2738    } 
     2739 
     2740    if (status != PJ_SUCCESS) 
     2741        return status; 
     2742 
     2743    /* Save in internal param for later device open */ 
     2744    if (keep) { 
     2745        status = pjmedia_aud_param_set_cap(&pjsua_var.aud_param, 
     2746                                           cap, pval); 
     2747    } 
     2748 
     2749    return status; 
    27472750} 
    27482751 
     
    27572760     * volume) 
    27582761     */ 
    2759     if (pjsua_var.aud_open_cnt==0) 
     2762    if (pjsua_var.aud_open_cnt==0) { 
     2763        PJ_LOG(4,(THIS_FILE, "Opening sound device to get initial settings")); 
    27602764        pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 
     2765        close_snd_dev(); 
     2766    } 
    27612767 
    27622768    if (pjsua_snd_is_active()) { 
Note: See TracChangeset for help on using the changeset viewer.