Ignore:
Timestamp:
Sep 24, 2014 10:30:57 AM (10 years ago)
Author:
nanang
Message:

Fix #1794: Fixed assertion or garbled audio in call using G.722.1:

  • Updated stream info to use pjmedia_sdp_neg_fmt_match() for matching formats in SDP, so it will call codec specific match function, e.g: for G.722.1 it will match the bitrate too.
  • Workaround for 'stream uses wrong codec param for opening G.722.1' issue, it is the G.722.1 codec that check the SDP fmtp for fetching bitrate setting (instead of using avg_bps/max_bps fields in codec param).
File:
1 edited

Legend:

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

    r4890 r4930  
    1919 */ 
    2020#include <pjmedia/stream.h> 
     21#include <pjmedia/sdp_neg.h> 
    2122#include <pjmedia/stream_common.h> 
    2223#include <pj/ctype.h> 
     
    189190        si->tx_pt = 0xFFFF; 
    190191        for (i=0; i<rem_m->desc.fmt_count; ++i) { 
    191             unsigned rpt; 
    192             pjmedia_sdp_attr *r_attr; 
    193             pjmedia_sdp_rtpmap r_rtpmap; 
    194  
    195             rpt = pj_strtoul(&rem_m->desc.fmt[i]); 
    196             if (rpt < 96) 
    197                 continue; 
    198  
    199             r_attr = pjmedia_sdp_media_find_attr(rem_m, &ID_RTPMAP, 
    200                                                  &rem_m->desc.fmt[i]); 
    201             if (!r_attr) 
    202                 continue; 
    203  
    204             if (pjmedia_sdp_attr_get_rtpmap(r_attr, &r_rtpmap) != PJ_SUCCESS) 
    205                 continue; 
    206  
    207             if (!pj_stricmp(&rtpmap->enc_name, &r_rtpmap.enc_name) && 
    208                 rtpmap->clock_rate == r_rtpmap.clock_rate) 
     192            if (pjmedia_sdp_neg_fmt_match(pool, 
     193                                          (pjmedia_sdp_media*)local_m, fmti, 
     194                                          (pjmedia_sdp_media*)rem_m, i, 0) == 
     195                PJ_SUCCESS) 
    209196            { 
    210197                /* Found matched codec. */ 
    211                 si->tx_pt = rpt; 
    212  
     198                si->tx_pt = pj_strtoul(&rem_m->desc.fmt[i]); 
    213199                break; 
    214200            } 
Note: See TracChangeset for help on using the changeset viewer.