Changeset 3289:1d9f8ad41d5d in roaraudio


Ignore:
Timestamp:
02/01/10 16:47:03 (10 years ago)
Author:
phi
Branch:
default
Message:

honor network byte order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_rtp.c

    r3288 r3289  
    185185 
    186186 // TODO: check old seqnum < new seqnum 
    187  self->header.seq_num      = data.u16[1]; 
     187 self->header.seq_num      = ROAR_NET2HOST16(data.u16[1]); 
    188188 
    189189 // TODO: check timestamp: 
    190  self->header.ts           = data.u32[1]; 
    191  
    192  self->header.ssrc         = data.u32[2]; 
     190 self->header.ts           = ROAR_NET2HOST32(data.u32[1]); 
     191 
     192 self->header.ssrc         = ROAR_NET2HOST32(data.u32[2]); 
    193193 
    194194 for (i = 0; i < self->header.csrc_count; i++) { 
    195   self->header.csrc[i]     = data.u32[3+i]; 
     195  self->header.csrc[i]     = ROAR_NET2HOST16(data.u32[3+i]); 
    196196 } 
    197197 
     
    286286 data.cp[1]  |= self->header.payload_type << 1; 
    287287 
    288  data.u16[1]  = self->header.seq_num; 
    289  
    290  data.u32[1]  = self->header.ts; 
    291  data.u32[2]  = self->header.ssrc; 
     288 data.u16[1]  = ROAR_HOST2NET16(self->header.seq_num); 
     289 
     290 data.u32[1]  = ROAR_HOST2NET32(self->header.ts); 
     291 data.u32[2]  = ROAR_HOST2NET32(self->header.ssrc); 
    292292 
    293293 for (i = 0; i < self->header.csrc_count; i++) { 
    294   data.u32[3+i] = self->header.csrc[i]; 
     294  data.u32[3+i] = ROAR_HOST2NET32(self->header.csrc[i]); 
    295295 } 
    296296 
Note: See TracChangeset for help on using the changeset viewer.