Changeset 1822:d2c299cb9a27 in roaraudio
- Timestamp:
- 05/23/09 00:13:18 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/light.c
r1821 r1822 65 65 66 66 int light_check_stream (int id) { 67 int len; 68 struct roar_stream * s; 69 struct roar_stream_server * ss; 70 71 if ( g_streams[id] == NULL ) 72 return -1; 73 74 ROAR_DBG("light_check_stream(id=%i) = ?", id); 75 76 s = ROAR_STREAM(ss = g_streams[id]); 77 67 78 return 0; 68 79 } 69 80 70 81 int light_send_stream (int id) { 82 int chans; 83 struct roar_stream * s; 84 struct roar_stream_server * ss; 85 char buf[512]; 86 87 if ( g_streams[id] == NULL ) 88 return -1; 89 90 ROAR_DBG("light_check_stream(id=%i) = ?", id); 91 92 s = ROAR_STREAM(ss = g_streams[id]); 93 94 switch (s->info.codec) { 95 case ROAR_CODEC_DMX512: 96 chans = g_light_state.channels; 97 98 if ( chans > 512 ) 99 chans = 512; 100 101 if ( stream_vio_s_write(ss, g_light_state.state, chans) != chans ) { 102 streams_delete(id); 103 return -1; 104 } 105 106 if ( chans < 512 ) { 107 chans = 512 - chans; 108 memset(buf, 0, chans); 109 if ( stream_vio_s_write(ss, g_light_state.state, chans) != chans ) { 110 streams_delete(id); 111 return -1; 112 } 113 } 114 115 return 0; 116 break; 117 default: 118 streams_delete(id); 119 return -1; 120 } 121 71 122 return 0; 72 123 }
Note: See TracChangeset
for help on using the changeset viewer.