Changeset 1000:43afe5f9b605 in roaraudio


Ignore:
Timestamp:
12/19/08 00:17:51 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added Ogg FLAC and Ogg Speex magic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/file.c

    r889 r1000  
    4444  if ( strncmp(buf, "OggS", 4) == 0 ) { 
    4545   codec = ROAR_CODEC_OGG_GENERAL; 
    46    if ( len > 34 ) { // this is 7 bytes after the end of the header 
    47     if ( strncmp(buf+28, "\001vorbis", 7) == 0 ) 
    48      codec = ROAR_CODEC_OGG_VORBIS; 
     46   if ( len > 32 ) { // this is 5 bytes after the end of the header 
     47    if ( strncmp(buf+28, "\177FLAC", 5) == 0 ) { 
     48     codec = ROAR_CODEC_OGG_FLAC; 
     49    } else if ( strncmp(buf+28, "Speex", 5) == 0 ) { 
     50     codec = ROAR_CODEC_OGG_SPEEX; 
     51    } else if ( len > 34 ) { // this is 7 bytes after the end of the header 
     52     if ( strncmp(buf+28, "\001vorbis", 7) == 0 ) 
     53      codec = ROAR_CODEC_OGG_VORBIS; 
     54    } 
    4955   } 
    5056  } else if ( strncmp(buf, "MThd", 4) == 0 ) { 
     
    195201 codec = roar_file_codecdetect(buf, len); 
    196202 
     203 ROAR_DBG("roar_file_play_full(*): codec=%i(%s)", codec, roar_codec2str(codec)); 
     204 
    197205 seek = lseek(in, 0, SEEK_SET) == (off_t) -1 ? 0 : 1; 
    198206 
Note: See TracChangeset for help on using the changeset viewer.