Changeset 826

Show
Ignore:
Timestamp:
2005-02-03 02:01:02 (4 years ago)
Author:
conrad
Message:

add support for seeking on old flac0 format (thanks illi!)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • liboggz/trunk/src/liboggz/oggz_auto.c

    r804 r826  
    238238 
    239239static int 
     240auto_flac0 (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) 
     241{ 
     242  unsigned char * header = op->packet; 
     243  int content; 
     244  ogg_int64_t granule_rate = 0; 
     245 
     246  if (op->b_o_s) { 
     247    if (op->bytes < 4) return 0; 
     248    if (strncmp ((char *)header, "fLaC", 4)) return 0; 
     249    oggz_stream_set_content (oggz, serialno, OGGZ_CONTENT_FLAC0); 
     250  } else { 
     251    content = oggz_stream_get_content (oggz, serialno); 
     252    if (content != OGGZ_CONTENT_FLAC0) return 0; 
     253 
     254    granule_rate = (ogg_int64_t) (header[14] << 12) | (header[15] << 4) | ((header[16] >> 4)&0xf); 
     255#ifdef DEBUG 
     256    printf ("Got flac rate %d\n", (int)granule_rate); 
     257#endif 
     258     
     259    oggz_set_metric_linear (oggz, serialno, granule_rate, OGGZ_AUTO_MULT); 
     260  } 
     261 
     262  return 1; 
     263} 
     264 
     265static int 
    240266auto_flac (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) 
    241267{ 
     
    355381  auto_annodex, 
    356382  auto_anxdata, 
     383  auto_flac0, 
    357384  auto_flac, 
    358385  auto_cmml, 
  • liboggz/trunk/src/liboggz/oggz_stream.h

    r710 r826  
    3636enum { 
    3737  OGGZ_CONTENT_UNKNOWN = 0, 
    38   OGGZ_CONTENT_SKELETON = 1 
     38  OGGZ_CONTENT_SKELETON = 1, 
     39  OGGZ_CONTENT_FLAC0 = 13 
    3940}; 
    4041