Changeset 3367

Show
Ignore:
Timestamp:
2008-01-20 18:04:28 (11 months ago)
Author:
conrad
Message:

decode FLAC vorbiscomments packet

Files:

Legend:

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

    r3365 r3367  
    971971{ 
    972972  int offset = -1; 
     973  long len = -1; 
    973974 
    974975  switch (stream->content) { 
     
    983984        offset = 7; 
    984985      break; 
     986    case OGGZ_CONTENT_FLAC: 
     987      if (op->bytes > 4 && (op->packet[0] & 0x7) == 4) { 
     988        len = (op->packet[1]<<16) + (op->packet[2]<<8) + op->packet[3]; 
     989        offset = 4; 
     990      } 
    985991    default: 
    986992      break; 
    987993  } 
    988994 
     995  /* The length of the comments to decode is the rest of the packet, 
     996   * unless otherwise determined (ie. for FLAC) */ 
     997  if (len == -1) 
     998    len = op->bytes - offset; 
     999 
    9891000  if (offset >= 0) { 
    990     oggz_comments_decode (oggz, serialno, op->packet+offset, op->bytes-offset); 
     1001    oggz_comments_decode (oggz, serialno, op->packet+offset, len); 
    9911002  } 
    9921003