Changeset 2528:3869d27a5594 in roaraudio for plugins/roard


Ignore:
Timestamp:
09/01/09 19:50:12 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

done emul_esd_on_stream() and implemented emul_esd_int_read_buf()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/protocol-esound.c

    r2527 r2528  
    134134 
    135135// porto lib: 
     136int emul_esd_int_read_buf  (int client, int * data, void * buf) { 
     137 _cmd_t d; 
     138 
     139 if ( data == NULL || buf == NULL ) 
     140  return -1; 
     141 
     142 d = *(_cmd_t*)buf; 
     143 
     144 *data = d; 
     145 
     146 return 0; 
     147} 
    136148int emul_esd_int_read      (int client, int * data, struct roar_vio_calls * vio) { 
    137149 _cmd_t d; 
     
    183195 int stream; 
    184196 int dir = -1; 
     197 int esdformat; 
     198 int rate; 
    185199 
    186200 if ( client == -1 || cmd == NULL || data == NULL || vio == NULL ) 
     
    219233 } 
    220234 
     235 emul_esd_int_read_buf(client, &esdformat, data); 
     236 emul_esd_int_read_buf(client, &rate,      data+_INTSIZE); 
     237 
     238 s->info.rate = rate; 
     239 
     240 switch (esdformat & ESD_MASK_BITS) { 
     241  case ESD_BITS8:  s->info.bits =  8; break; 
     242  case ESD_BITS16: s->info.bits = 16; break; 
     243  default: 
     244    streams_delete(stream); 
     245    clients_delete(client); 
     246    return -1; 
     247 } 
     248 
     249 switch (esdformat & ESD_MASK_CHAN) { 
     250  case ESD_MONO:   s->info.channels = 1; break; 
     251  case ESD_STEREO: s->info.channels = 2; break; 
     252  default: 
     253    streams_delete(stream); 
     254    clients_delete(client); 
     255    return -1; 
     256 } 
     257 
    221258 ss->codec_orgi = s->info.codec; 
    222259 
Note: See TracChangeset for help on using the changeset viewer.