Commit 1abb409b authored by conrad's avatar conrad

add CMML binary header parsing


git-svn-id: http://svn.annodex.net/liboggz/trunk@691 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 8a463960
Fri Jan 21 17:38:33 EST 2005 Conrad Parker <conrad@annodex.net>
* added FLAC header parsing from Tobias Gehrig
* added CMML header parsing
Fri May 28 11:08:34 EST 2004 Conrad Parker <conrad@annodex.net>
......
......@@ -247,6 +247,31 @@ auto_flac (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
return 1;
}
static int
auto_cmml (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
{
unsigned char * header = op->packet;
ogg_int64_t granule_rate_numerator = 0, granule_rate_denominator = 0;
if (op->bytes < 28) return 0;
if (strncmp ((char *)header, "CMML", 4)) return 0;
if (!op->b_o_s) return 0;
granule_rate_numerator = INT64_LE_AT(&header[12]);
granule_rate_denominator = INT64_LE_AT(&header[20]);
#ifdef DEBUG
printf ("Got CMML rate %lld/%lld\n", granule_rate_numerator,
granule_rate_denominator);
#endif
oggz_set_metric_linear (oggz, serialno,
granule_rate_numerator,
OGGZ_AUTO_MULT * granule_rate_denominator);
return 1;
}
static const OggzReadPacket auto_readers[] = {
auto_speex,
auto_vorbis,
......@@ -254,6 +279,7 @@ static const OggzReadPacket auto_readers[] = {
auto_annodex,
auto_anxdata,
auto_flac,
auto_cmml,
NULL
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment