Changeset 4602


Ignore:
Timestamp:
Sep 25, 2013 4:57:26 AM (11 years ago)
Author:
nanang
Message:

Fix #1700: Added PJ_ICE_CAND_TYPE_MAX to represent the number ICE candidate types.

Location:
pjproject/trunk/pjnath
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/include/pjnath/ice_session.h

    r4360 r4602  
    155155     * TURN server. 
    156156     */ 
    157     PJ_ICE_CAND_TYPE_RELAYED 
     157    PJ_ICE_CAND_TYPE_RELAYED, 
     158 
     159    /** 
     160     * Number of defined ICE candidate types. 
     161     */ 
     162    PJ_ICE_CAND_TYPE_MAX 
    158163 
    159164} pj_ice_cand_type; 
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r4582 r4602  
    8181 
    8282/* Candidate type preference */ 
    83 static pj_uint8_t cand_type_prefs[4] = 
     83static pj_uint8_t cand_type_prefs[PJ_ICE_CAND_TYPE_MAX] = 
    8484{ 
    8585#if PJ_ICE_CAND_TYPE_PREF_BITS < 8 
     
    546546    unsigned i; 
    547547    PJ_ASSERT_RETURN(ice && prefs, PJ_EINVAL); 
    548     ice->prefs = (pj_uint8_t*) pj_pool_calloc(ice->pool, PJ_ARRAY_SIZE(prefs), 
     548    ice->prefs = (pj_uint8_t*) pj_pool_calloc(ice->pool, PJ_ICE_CAND_TYPE_MAX, 
    549549                                              sizeof(pj_uint8_t)); 
    550     for (i=0; i<4; ++i) { 
     550    for (i=0; i<PJ_ICE_CAND_TYPE_MAX; ++i) { 
    551551#if PJ_ICE_CAND_TYPE_PREF_BITS < 8 
    552552        pj_assert(prefs[i] < (2 << PJ_ICE_CAND_TYPE_PREF_BITS)); 
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r4585 r4602  
    6666 
    6767/* The candidate type preference when STUN candidate is used */ 
    68 static pj_uint8_t srflx_pref_table[4] =  
     68static pj_uint8_t srflx_pref_table[PJ_ICE_CAND_TYPE_MAX] =  
    6969{ 
    7070#if PJNATH_ICE_PRIO_STD 
Note: See TracChangeset for help on using the changeset viewer.