Changeset 2061 for pjproject/trunk


Ignore:
Timestamp:
Jun 26, 2008 3:48:14 PM (16 years ago)
Author:
bennylp
Message:

Specifying star in codec selection will select all codecs. Fixed the codec selection in codec.c to select all codecs when empty string is given.

Location:
pjproject/trunk
Files:
3 edited

Legend:

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

    r2039 r2061  
    232232    for (i=0; i<mgr->codec_cnt; ++i) { 
    233233 
    234         if (pj_strnicmp2(codec_id, mgr->codec_desc[i].id,  
     234        if (codec_id->slen == 0 || 
     235            pj_strnicmp2(codec_id, mgr->codec_desc[i].id,  
    235236                         codec_id->slen) == 0)  
    236237        { 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r2039 r2061  
    27742774 
    27752775    puts(""); 
    2776     puts("Enter codec name and its new priority (e.g. \"speex/16000 200\"), empty to cancel:"); 
    2777  
    2778     printf("Codec name and priority: "); 
     2776    puts("Enter codec id and its new priority " 
     2777         "(e.g. \"speex/16000 200\"), empty to cancel:"); 
     2778 
     2779    printf("Codec name (\"*\" for all) and priority: "); 
    27792780    fgets(input, sizeof(input), stdin); 
    27802781    if (input[0]=='\r' || input[0]=='\n') { 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r2039 r2061  
    22282228                                              pj_uint8_t priority ) 
    22292229{ 
     2230    const pj_str_t all = { NULL, 0 }; 
    22302231    pjmedia_codec_mgr *codec_mgr; 
    22312232 
    22322233    codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt); 
     2234 
     2235    if (codec_id->slen==1 && *codec_id->ptr=='*') 
     2236        codec_id = &all; 
    22332237 
    22342238    return pjmedia_codec_mgr_set_codec_priority(codec_mgr, codec_id,  
     
    22432247                                           pjmedia_codec_param *param ) 
    22442248{ 
     2249    const pj_str_t all = { NULL, 0 }; 
    22452250    const pjmedia_codec_info *info; 
    22462251    pjmedia_codec_mgr *codec_mgr; 
     
    22502255    codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt); 
    22512256 
     2257    if (codec_id->slen==1 && *codec_id->ptr=='*') 
     2258        codec_id = &all; 
     2259 
    22522260    status = pjmedia_codec_mgr_find_codecs_by_id(codec_mgr, codec_id, 
    22532261                                                 &count, &info, NULL); 
Note: See TracChangeset for help on using the changeset viewer.