Changeset 2614:11dce7d724c4 in roaraudio


Ignore:
Timestamp:
09/11/09 15:57:24 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

set byte order on server side

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/roaraudio/client.h

    r2600 r2614  
    3838#define ROAR_PROTO_ESOUND           2 
    3939 
     40#define ROAR_BYTEORDER_UNKNOWN      0x00 
     41#define ROAR_BYTEORDER_LE           ROAR_CODEC_LE 
     42#define ROAR_BYTEORDER_BE           ROAR_CODEC_BE 
     43#define ROAR_BYTEORDER_PDP          ROAR_CODEC_PDP 
     44#define ROAR_BYTEORDER_NETWORK      ROAR_BYTEORDER_BE 
     45 
    4046struct roar_client { 
    4147 int fh; /* controll connection */ 
     
    5056 struct roar_acl_target * acl; 
    5157 int proto; 
     58 int byteorder; 
    5259}; 
    5360 
  • roard/clients.c

    r2608 r2614  
    6161    *n->host = 0; 
    6262 
    63     n->proto = ROAR_PROTO_ROARAUDIO; 
     63    n->proto     = ROAR_PROTO_ROARAUDIO; 
     64    n->byteorder = ROAR_BYTEORDER_NETWORK; 
    6465 
    6566    n->acl   = NULL; 
     
    167168 
    168169int clients_set_proto (int id, int    proto) { 
    169  if ( g_clients[id] == NULL ) 
    170   return -1; 
    171  
    172  g_clients[id]->proto = proto; 
     170 int byteorder = ROAR_BYTEORDER_UNKNOWN; 
     171 
     172 if ( g_clients[id] == NULL ) 
     173  return -1; 
     174 
     175 switch (proto) { 
     176  case ROAR_PROTO_ROARAUDIO: 
     177    byteorder = ROAR_BYTEORDER_NETWORK; 
     178   break; 
     179 } 
     180 
     181 g_clients[id]->proto     = proto; 
     182 g_clients[id]->byteorder = byteorder; 
    173183 
    174184 return 0; 
Note: See TracChangeset for help on using the changeset viewer.