Ignore:
Timestamp:
Feb 1, 2009 2:10:49 PM (12 years ago)
Author:
nanang
Message:
  • Fixed pjmedia_frame_ext helper functions, it didn't involve sizeof(bitlen) in calculating subframe address.
  • Fixed audio switch board to handle such case that transmitter of port 0 has greater ptime, so it could save the remaining data in the TX buffer.
  • Fixed audio swtich board in handling FRAME_TYPE_NONE.
  • Updated audio switch board to handle keep alive mechanism.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/port.h

    r2436 r2437  
    265265 * are byte-aligned although its payload may not be byte-aligned. 
    266266 */ 
     267 
     268#pragma pack(1) 
    267269typedef struct pjmedia_frame_ext { 
    268270    pjmedia_frame   base;           /**< Base frame info */ 
     
    274276     */ 
    275277} pjmedia_frame_ext; 
     278#pragma pack() 
    276279 
    277280/** 
     
    279282 * pjmedia_frame_ext structure. 
    280283 */ 
     284#pragma pack(1) 
    281285typedef struct pjmedia_frame_ext_subframe { 
    282286    pj_uint16_t     bitlen;         /**< Number of bits in the data */ 
     
    284288} pjmedia_frame_ext_subframe; 
    285289 
     290#pragma pack() 
     291 
    286292 
    287293/** 
     
    305311        pjmedia_frame_ext_subframe *fsub; 
    306312        fsub = (pjmedia_frame_ext_subframe*) p; 
    307         p += fsub->bitlen / 8; 
     313        p += sizeof(fsub->bitlen) + fsub->bitlen / 8; 
    308314        if (fsub->bitlen % 8) 
    309315            ++p; 
     
    312318    tmp = bitlen / 8; 
    313319    if (bitlen % 8) ++tmp; 
     320 
    314321    pj_memcpy(p, &bitlen, sizeof(bitlen)); 
    315     pj_memcpy(p + sizeof(bitlen), src, tmp); 
     322    if (tmp) 
     323        pj_memcpy(p + sizeof(bitlen), src, tmp); 
     324 
    316325    frm->subframe_cnt++; 
    317326    frm->samples_cnt = frm->samples_cnt + samples_cnt; 
     
    339348        for (i = 0; i < n; ++i) {        
    340349            sf = (pjmedia_frame_ext_subframe*) p; 
    341             p += sf->bitlen / 8; 
     350            p += sizeof(sf->bitlen) + sf->bitlen / 8; 
    342351            if (sf->bitlen % 8) 
    343352                ++p; 
Note: See TracChangeset for help on using the changeset viewer.