Changeset 776:1d9ce44598b2 in roaraudio
- Timestamp:
- 09/07/08 16:43:20 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/file.c
r774 r776 164 164 int in, out = -1; 165 165 ssize_t r = 0; 166 int seek; 166 167 int len; 167 168 char buf[BUFSIZE]; … … 192 193 codec = roar_file_codecdetect(buf, len); 193 194 195 seek = lseek(in, 0, SEEK_SET) == (off_t) -1 ? 0 : 1; 196 194 197 if ( codec == -1 ) { 195 198 close(in); 196 199 return -1; 200 } 201 202 if ( passfh && !seek ) { 203 ROAR_WARN("roar_file_play_full(*): passfh on non seekable file: this may produce incorrect playback"); 197 204 } 198 205 … … 217 224 out = con->fh; 218 225 } else { 219 if ( (out = roar_simple_new_stream_obj(con, s, rate, channels, bits, codec, ROAR_DIR_PLAY)) == -1 ) { 220 close(in); 221 return -1; 222 } 223 } 224 225 write(out, buf, len); 226 if ( !(passfh && seek) ) { 227 if ( (out = roar_simple_new_stream_obj(con, s, rate, channels, bits, codec, ROAR_DIR_PLAY)) == -1 ) { 228 close(in); 229 return -1; 230 } 231 } else { 232 if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) { 233 close(in); 234 return -1; 235 } 236 237 if ( roar_stream_connect(con, s, ROAR_DIR_PLAY) == -1 ) { 238 close(in); 239 return -1; 240 } 241 } 242 } 243 244 if ( !seek ) 245 write(out, buf, len); 226 246 227 247 if ( !passfh ) {
Note: See TracChangeset
for help on using the changeset viewer.