Changeset 1844:5454eaa259aa in roaraudio


Ignore:
Timestamp:
05/23/09 05:39:54 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corrected DMX512 codec filter to always write in 512 byte blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/light.c

    r1838 r1844  
    111111 struct roar_stream_server *  ss; 
    112112 char buf[512]; 
     113 register char * bufptr; 
    113114 
    114115 if ( g_streams[id] == NULL ) 
     
    126127     chans = 512; 
    127128 
    128     if ( stream_vio_s_write(ss, g_light_state.state, chans) != chans ) { 
     129    if ( chans == 512 ) { 
     130     bufptr = g_light_state.state; 
     131    } else { 
     132     memset(buf, 0, 512); 
     133     memcpy(buf, g_light_state.state, chans); 
     134     bufptr = buf; 
     135    } 
     136 
     137    if ( stream_vio_s_write(ss, bufptr, 512) != 512 ) { 
    129138     streams_delete(id); 
    130139     return -1; 
    131     } 
    132  
    133     if ( chans < 512 ) { 
    134      chans = 512 - chans; 
    135      memset(buf, 0, chans); 
    136      if ( stream_vio_s_write(ss, g_light_state.state, chans) != chans ) { 
    137       streams_delete(id); 
    138       return -1; 
    139      } 
    140140    } 
    141141 
Note: See TracChangeset for help on using the changeset viewer.