Changeset 506:8548c6327f60 in roaraudio


Ignore:
Timestamp:
08/14/08 19:16:33 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_stream_send_data()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/stream.h

    r492 r506  
    3030int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); 
    3131 
     32int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); 
     33 
    3234int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info); 
    3335 
  • libroar/stream.c

    r496 r506  
    138138  return 0; 
    139139 return -1; 
     140} 
     141 
     142int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) { 
     143 if ( ! s ) 
     144  return -1; 
     145 
     146 if ( s->fh == -1 ) { 
     147  if ( !con ) 
     148   return -1; 
     149 
     150  if ( roar_stream_add_data(con, s, data, len) == -1 ) 
     151   return -1; 
     152 
     153  return len; 
     154 } 
     155 
     156 return write(s->fh, data, len); 
    140157} 
    141158 
Note: See TracChangeset for help on using the changeset viewer.