Changeset 5463:f11febcac1de in roaraudio


Ignore:
Timestamp:
03/31/12 00:26:21 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corrected handling of pos in v2 messages

Location:
libroar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libroar/proto.c

    r5381 r5463  
    9696    *(uint32_t*)(buf+4) = ROAR_HOST2NET32(mes->flags); 
    9797    if ( mes->flags & ROAR_MF_LSPOS ) { 
    98      *(uint64_t*)(buf+8) = ROAR_HOST2NET16(mes->pos64); 
     98     *(uint64_t*)(buf+8) = ROAR_HOST2NET64(mes->pos64); 
    9999     bufptr = buf+16; 
    100100     headerlen          += 4; 
    101101    } else { 
    102      *(uint32_t*)(buf+8) = ROAR_HOST2NET16(mes->pos); 
     102     *(uint32_t*)(buf+8) = ROAR_HOST2NET32(mes->pos); 
    103103     bufptr = buf+12; 
    104104    } 
     
    192192    mes->stream  = ROAR_NET2HOST16(*(uint16_t*)(buf+2)); 
    193193    mes->pos     = ROAR_NET2HOST32(*(uint32_t*)(buf+4)); 
     194    mes->pos64   = mes->pos; 
    194195    mes->datalen = ROAR_NET2HOST16(*(uint16_t*)(buf+8)); 
    195196   break; 
     
    224225    if ( mes->flags & ROAR_MF_LSPOS ) { 
    225226     mes->pos64   = ROAR_NET2HOST32(*(uint64_t*)(buf+8)); 
     227     mes->pos     = mes->pos64 & (uint64_t)0x0FFFFFFFFLLU; 
    226228     bufptr       = buf+16; 
    227229    } else { 
    228230     mes->pos     = ROAR_NET2HOST32(*(uint32_t*)(buf+8)); 
     231     mes->pos64   = mes->pos; 
    229232     bufptr       = buf+12; 
    230233    } 
  • libroar/stream.c

    r5381 r5463  
    765765#endif 
    766766 
    767  m->pos = s->pos; 
     767 m->pos   = s->pos; 
     768 m->pos64 = s->pos; 
    768769 
    769770 return 0; 
     
    783784 } 
    784785 
    785  s->pos = m->pos; 
     786 if ( m->flags & ROAR_MF_LSPOS ) { 
     787  s->pos = m->pos64; 
     788 } else { 
     789  s->pos = m->pos; 
     790 } 
    786791 
    787792 data = (uint32_t*) m->data; 
Note: See TracChangeset for help on using the changeset viewer.