From 5e2f11ad655051296b64af86b33a8bbb0229272b Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Mon, 13 Jul 2009 15:23:07 +0000 Subject: Import Vorbis seeking improvements from Tremor SVN. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21841 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libtremor/info.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/codecs/libtremor/info.c') diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index cb3860bbff..4273f97dc1 100644 --- a/apps/codecs/libtremor/info.c +++ b/apps/codecs/libtremor/info.c @@ -232,6 +232,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.3