Changeset 555:3e21244380f6 in roaraudio


Ignore:
Timestamp:
08/18/08 21:08:28 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

removed CELT_PREFIX and added INCPATH

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/file.h

    r215 r555  
    1010#endif 
    1111 
     12int     roar_file_codecdetect(char * buf, int len); 
    1213ssize_t roar_file_send_raw (int out, int in); 
    1314ssize_t roar_file_play     (struct roar_connection * con, char * file, int exec); 
  • roard/sources.c

    r542 r555  
    100100 
    101101int sources_add_cf (char * driver, char * device, char * container, char * options, int primary) { 
    102  int stream; 
    103  int fh; 
    104  int codec; 
     102 int  stream; 
     103 int  fh; 
     104 int  codec; 
     105 int  len; 
     106 char buf[64]; 
    105107 struct roar_stream * s; 
    106  
    107  if ( (codec = roar_str2codec(options)) == -1 ) 
    108   return -1; 
    109108 
    110109 if ( (fh = open(device, O_RDONLY, 0644)) == -1 ) { 
    111110  return -1; 
     111 } 
     112 
     113 if ( !options ) { 
     114  if ( (len = read(fh, buf, 64)) < 1 ) { 
     115   close(fh); 
     116   return -1; 
     117  } 
     118 
     119  if ( lseek(fh, -len, SEEK_CUR) == (off_t)-1 ) { 
     120   close(fh); 
     121   return -1; 
     122  } 
     123 
     124  if ( (codec = roar_file_codecdetect(buf, len)) == -1 ) { 
     125   close(fh); 
     126   return -1; 
     127  } 
     128 } else { 
     129  if ( (codec = roar_str2codec(options)) == -1 ) { 
     130   close(fh); 
     131   return -1; 
     132  } 
    112133 } 
    113134 
Note: See TracChangeset for help on using the changeset viewer.