Changeset 4584:959c2d722ca8 in roaraudio
- Timestamp:
- 11/05/10 00:53:04 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vs.c
r4581 r4584 236 236 ssize_t ret; 237 237 int dir = O_RDONLY; 238 int codec; 238 int codec = -1; 239 const char * content_type; 239 240 240 241 _ckvss(-1); … … 266 267 267 268 if ( !(vss->flags & FLAG_STREAM) ) { 268 ret = roar_vio_read(file, buf, sizeof(buf)); 269 270 codec = roar_file_codecdetect(buf, ret); 271 272 if ( vss->info.codec == -1 ) { 273 roar_vio_close(file); 274 return -1; 269 if ( roar_vio_ctl(file, ROAR_VIO_CTL_GET_MIMETYPE, &content_type) != -1 ) { 270 codec = roar_mime2codec(content_type); 271 } 272 273 if ( codec == -1 ) { 274 ret = roar_vio_read(file, buf, sizeof(buf)); 275 276 codec = roar_file_codecdetect(buf, ret); 277 278 if ( codec == -1 ) { 279 roar_vio_close(file); 280 return -1; 281 } 282 283 if ( roar_vio_lseek(file, 0, SEEK_SET) != 0 ) { 284 roar_vio_close(file); 285 return -1; 286 } 275 287 } 276 288 … … 281 293 vss->info.codec = codec; 282 294 vss->info.bits = ROAR_BITS_DEFAULT; 283 284 if ( roar_vio_lseek(file, 0, SEEK_SET) != 0 ) {285 roar_vio_close(file);286 return -1;287 }288 295 289 296 ret = roar_vs_stream(vss, &(vss->info), ROAR_DIR_PLAY, error);
Note: See TracChangeset
for help on using the changeset viewer.