From 4ce4ec7859e7f8074341cfb00af1c207f5d24d3f Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 11 Jul 2009 10:03:10 +0000 Subject: Merge recent vorbifile changes, extensions and fixes back from reference 1.2.2 and 1.2.3 into tremor. git-svn-id: https://svn.xiph.org/trunk/Tremor@16259 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- info.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'info.c') diff --git a/info.c b/info.c index 33acf16..e03188d 100644 --- a/info.c +++ b/info.c @@ -293,6 +293,31 @@ static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ return(OV_EBADHEADER); } +/* Is this packet a vorbis ID header? */ +int vorbis_synthesis_idheader(ogg_packet *op){ + oggpack_buffer opb; + char buffer[6]; + + if(op){ + oggpack_readinit(&opb,op->packet); + + if(!op->b_o_s) + return(0); /* Not the initial packet */ + + if(oggpack_read(&opb,8) != 1) + return 0; /* not an ID header */ + + memset(buffer,0,6); + _v_readstring(&opb,buffer,6); + if(memcmp(buffer,"vorbis",6)) + return 0; /* not vorbis */ + + return 1; + } + + return 0; +} + /* The Vorbis header is in three packets; the initial small packet in the first page that identifies basic parameters, a second packet with bitstream comments and a third packet that holds the -- cgit v1.2.1