Commit a31db8f0 authored by conrad's avatar conrad

add OggPCM2 support to oggz tools: oggzinfo, oggz-validate, and allow

[--content-type pcm, -c pcm] option in oggzdump, oggzrip etc.
 + correction in header diagram in oggz_auto.h


git-svn-id: http://svn.annodex.net/liboggz/trunk@2062 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 8fc80f3c
......@@ -263,7 +263,7 @@ auto_oggpcm2 (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
unsigned char * header = op->packet;
ogg_int64_t granule_rate;
if (op->bytes < 27) return 0;
if (op->bytes < 28) return 0;
if (strncmp ((char *)header, "PCM ", 8)) return 0;
if (!op->b_o_s) return 0;
......
......@@ -381,12 +381,10 @@ This was the Theora header for theora-alpha2:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sampling rate [Hz] | 16-19
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of significant bits | 20-23
| Num. sig. bits| Num. channels | Max. num. frames per packet | 20-23
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Num. channels | Max. num. frames per packet | Number of ... | 24-27
| Number of extra header packets | 24-27
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| extra header packets | | 28-31
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
......
......@@ -174,6 +174,22 @@ ot_speex_info (unsigned char * data, long len)
return buf;
}
static char *
ot_oggpcm2_info (unsigned char * data, long len)
{
char * buf;
if (len < 28) return NULL;
buf = malloc (60);
snprintf (buf, 60,
"\tAudio-Samplerate: %d Hz\n\tAudio-Channels: %d\n",
INT32_BE_AT(&data[16]), (int)data[21]);
return buf;
}
static char *
ot_skeleton_info (unsigned char * data, long len)
{
......@@ -195,6 +211,7 @@ static const OTCodecIdent codec_ident[] = {
{"\200theora", 7, "Theora", ot_theora_info},
{"\001vorbis", 7, "Vorbis", ot_vorbis_info},
{"Speex", 5, "Speex", ot_speex_info},
{"PCM ", 8, "PCM", ot_oggpcm2_info},
{"CMML\0\0\0\0", 8, "CMML", NULL},
{"Annodex", 8, "Annodex", NULL},
{"fishead", 8, "Skeleton", ot_skeleton_info},
......
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