Ignore:
Timestamp:
Apr 29, 2006 8:23:37 AM (18 years ago)
Author:
bennylp
Message:

Fixed bugs in codec priority sorting

File:
1 edited

Legend:

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

    r419 r421  
    407407 
    408408 
     409 
     410#if PJ_LOG_MAX_LEVEL >= 3 
     411static const char *good_number(char *buf, pj_int32_t val) 
     412{ 
     413    if (val < 1000) { 
     414        pj_ansi_sprintf(buf, "%d", val); 
     415    } else if (val < 1000000) { 
     416        pj_ansi_sprintf(buf, "%d.%dK",  
     417                        val / 1000, 
     418                        (val % 1000) / 100); 
     419    } else { 
     420        pj_ansi_sprintf(buf, "%d.%02dM",  
     421                        val / 1000000, 
     422                        (val % 1000000) / 10000); 
     423    } 
     424 
     425    return buf; 
     426} 
     427#endif 
     428 
    409429PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt) 
    410430{ 
     
    428448        const char *type; 
    429449        pjmedia_codec_param param; 
     450        char bps[16]; 
    430451 
    431452        switch (codec_info[i].type) { 
     
    446467 
    447468        PJ_LOG(3,(THIS_FILE,  
    448                   "   %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %d bps, ptime=%d ms, vad=%d, cng=%d)",  
     469                  "   %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %sbps, ptime=%d ms, vad=%d, cng=%d)",  
    449470                  type, i, codec_info[i].pt, 
    450471                  (int)codec_info[i].encoding_name.slen, 
     
    452473                  codec_info[i].clock_rate/1000, 
    453474                  codec_info[i].channel_cnt, 
    454                   param.avg_bps, param.ptime, 
     475                  good_number(bps, param.avg_bps),  
     476                  param.ptime, 
    455477                  param.vad, 
    456478                  param.cng)); 
Note: See TracChangeset for help on using the changeset viewer.