summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor/info.c')
-rw-r--r--apps/codecs/libtremor/info.c25
1 files changed, 25 insertions, 0 deletions
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){
232 return(OV_EBADHEADER); 232 return(OV_EBADHEADER);
233} 233}
234 234
235/* Is this packet a vorbis ID header? */
236int vorbis_synthesis_idheader(ogg_packet *op){
237 oggpack_buffer opb;
238 char buffer[6];
239
240 if(op){
241 oggpack_readinit(&opb,op->packet);
242
243 if(!op->b_o_s)
244 return(0); /* Not the initial packet */
245
246 if(oggpack_read(&opb,8) != 1)
247 return 0; /* not an ID header */
248
249 memset(buffer,0,6);
250 _v_readstring(&opb,buffer,6);
251 if(memcmp(buffer,"vorbis",6))
252 return 0; /* not vorbis */
253
254 return 1;
255 }
256
257 return 0;
258}
259
235/* The Vorbis header is in three packets; the initial small packet in 260/* The Vorbis header is in three packets; the initial small packet in
236 the first page that identifies basic parameters, a second packet 261 the first page that identifies basic parameters, a second packet
237 with bitstream comments and a third packet that holds the 262 with bitstream comments and a third packet that holds the