Changeset 3824:32199d63f4d4 in roaraudio
- Timestamp:
- 05/11/10 17:34:34 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/emul_rsound.c
r3820 r3824 36 36 int client; 37 37 union { 38 int32_t i[ 2];39 char c[ 8];38 int32_t i[4]; 39 char c[16]; 40 40 } buf; 41 41 … … 69 69 buf.i[0] = ROAR_HOST2NET32(0); 70 70 buf.i[1] = ROAR_HOST2NET32(512); 71 72 ROAR_NETWORK_WRITE(oldfh, buf.c, 8); 71 buf.i[2] = ROAR_HOST2NET32(0); 72 buf.i[3] = ROAR_HOST2NET32(0); 73 74 ROAR_NETWORK_WRITE(oldfh, buf.c, sizeof(buf.c)); 73 75 74 76 return client; … … 197 199 198 200 int emul_rsound_check_client(int client, struct roar_vio_calls * vio) { 199 struct roar_vio_calls rvio; 200 struct emul_rsound_msg msg; 201 struct roar_vio_calls rvio; 202 struct emul_rsound_msg msg; 203 struct roar_client * c; 204 struct roar_stream_server * ss; 205 int streamid; 206 int i; 207 ssize_t ptr; 201 208 202 209 if ( vio == NULL ) { … … 210 217 if ( !strncmp(msg.datasp, "INFO", 4) ) { 211 218 // TODO: add support for INFO 212 return clients_delete(client); 219 if ( clients_get(client, &c) == -1 ) 220 return clients_delete(client); 221 222 streamid = -1; 223 for (i = 0; i < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; i++) 224 if ( c->streams[i] > streamid ) 225 streamid = c->streams[i]; 226 227 if ( streamid == -1 ) 228 return clients_delete(client); 229 230 if ( streams_get(streamid, &ss) == -1 ) 231 return clients_delete(client); 232 233 ptr = roar_info2samplesize(&(ROAR_STREAM(ss)->info)); 234 235 if ( ptr == -1 ) 236 return clients_delete(client); 237 238 ptr *= ROAR_STREAM(ss)->pos; 239 ptr /= 8; // bits -> bytes 240 241 i = snprintf(msg.data+msg.datalen, EMUL_RSOUND_MSG_DATA_LEN - msg.datalen, " %lld", (long long int)ptr); 242 243 msg.datalen += i; 244 245 return emul_rsound_vsend_msg(&msg, vio); 213 246 } else if ( !strncmp(msg.datasp, "NULL", 4) ) { 214 247 // NULL is simular to NOOP
Note: See TracChangeset
for help on using the changeset viewer.