Changeset 555:3e21244380f6 in roaraudio for roard
- Timestamp:
- 08/18/08 21:08:28 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/sources.c
r542 r555 100 100 101 101 int 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]; 105 107 struct roar_stream * s; 106 107 if ( (codec = roar_str2codec(options)) == -1 )108 return -1;109 108 110 109 if ( (fh = open(device, O_RDONLY, 0644)) == -1 ) { 111 110 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 } 112 133 } 113 134
Note: See TracChangeset
for help on using the changeset viewer.