Changeset 3921:4c4449728a41 in roaraudio


Ignore:
Timestamp:
06/09/10 09:37:40 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added RSD EXEC feature to protocol emulation

Location:
roard
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r3920 r3921  
    568568  if ( g_clients[client]->streams[i] == stream ) { 
    569569   g_clients[client]->execed = stream; 
    570    if ( (fh = streams_get_fh(stream)) == -1 ) { 
     570   if ( streams_is_ready(stream) == 0 ) { 
    571571    streams_set_fh(stream, g_clients[client]->fh); 
    572572    streams_set_socktype(stream, ROAR_SOCKET_TYPE_GENSTR); 
    573573   } else { 
     574    fh = streams_get_fh(stream); 
     575    ROAR_DBG("client_stream_exec(client=%i, stream=%i): fh=%i", client, stream, fh); 
    574576    close(g_clients[client]->fh); 
    575577    g_clients[client]->fh = fh; 
  • roard/emul_rsound.c

    r3918 r3921  
    275275  strncpy(c->name, msg.datasp, max_len); 
    276276  c->name[max_len] = 0; 
     277 } else if ( !strncmp(msg.datasp, "CLOSECTL", 9) ) { 
     278  if ( clients_get(client, &c) == -1 ) 
     279   return clients_delete(client); 
     280 
     281  strncpy(msg.data, " CLOSECTL OK", EMUL_RSOUND_MSG_DATA_LEN); 
     282  msg.datalen = 12; //strlen(" CLOSECTL OK"); 
     283 
     284  if ( emul_rsound_vsend_msg(&msg, vio) == -1 ) { 
     285   return clients_delete(client); 
     286  } 
     287 
     288  streamid = c->streams[0]; 
     289  if ( client_stream_exec(client, streamid) == -1 ) { 
     290   return clients_delete(client); 
     291  } 
     292 
     293  return 0; 
    277294 } else { 
    278295  // Unknown command, kill the client. 
  • roard/include/streams.h

    r3811 r3921  
    127127int streams_get_socktype (int id); 
    128128 
     129int streams_is_ready     (int id); 
     130 
    129131int streams_set_primary  (int id, int prim); 
    130132int streams_mark_primary (int id); 
  • roard/streams.c

    r3823 r3921  
    680680} 
    681681 
     682int streams_is_ready     (int id) { 
     683 _CHECK_SID(id); 
     684 
     685 return g_streams[id]->ready; 
     686} 
     687 
    682688int streams_set_primary (int id, int prim) { 
    683689 _CHECK_SID(id); 
Note: See TracChangeset for help on using the changeset viewer.