Changeset 2265 for pjproject/trunk


Ignore:
Timestamp:
Sep 8, 2008 3:21:56 PM (16 years ago)
Author:
nanang
Message:

Fixed assertion caused by too small output buffer size of stream, this happens when codec with very small bandwidth is used, e.g: MELP 2.4kbps, (thanks William Wong).

File:
1 edited

Legend:

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

    r2244 r2265  
    13781378    pjmedia_channel *channel; 
    13791379    pj_status_t status; 
     1380    unsigned min_out_pkt_size; 
    13801381     
    13811382    /* Allocate memory for channel descriptor */ 
     
    14071408    if (channel->out_pkt_size > PJMEDIA_MAX_MTU) 
    14081409        channel->out_pkt_size = PJMEDIA_MAX_MTU; 
     1410 
     1411    /* It should big enough to hold (minimally) RTCP SR with an SDES. */ 
     1412    min_out_pkt_size =  sizeof(pjmedia_rtcp_sr_pkt) + 
     1413                        sizeof(pjmedia_rtcp_common) + 
     1414                        (4 + stream->cname.slen) + 
     1415                        32; 
     1416 
     1417    if (channel->out_pkt_size < min_out_pkt_size) 
     1418        channel->out_pkt_size = min_out_pkt_size; 
    14091419 
    14101420    channel->out_pkt = pj_pool_alloc(pool, channel->out_pkt_size); 
Note: See TracChangeset for help on using the changeset viewer.