annotate tremor/info.c @ 25735:a478f4d9de1f

added missing "&"
author ptt
date Tue, 15 Jan 2008 23:00:50 +0000
parents cd6b211be811
children e83eef58b30a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14280
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
1 /********************************************************************
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
2 * *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
4 * *
19251
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
8 * *
14280
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
11 * *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
12 ********************************************************************
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
13
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
14 function: maintain the info structure, info <-> header packets
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
15
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
16 ********************************************************************/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
17
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
18 /* general handling of the header and the vorbis_info structure (and
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
19 substructures) */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
20
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
21 #include <stdlib.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
22 #include <string.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
23 #include <ctype.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
24 #include "ogg.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
25 #include "ivorbiscodec.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
26 #include "codec_internal.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
27 #include "codebook.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
28 #include "registry.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
29 #include "window.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
30 #include "misc.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
31 #include "os.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
32
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
33 /* helpers */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
34 static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
35 while(bytes--){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
36 *buf++=oggpack_read(o,8);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
37 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
38 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
39
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
40 void vorbis_comment_init(vorbis_comment *vc){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
41 memset(vc,0,sizeof(*vc));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
42 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
43
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
44 /* This is more or less the same as strncasecmp - but that doesn't exist
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
45 * everywhere, and this is a fairly trivial function, so we include it */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
46 static int tagcompare(const char *s1, const char *s2, int n){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
47 int c=0;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
48 while(c < n){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
49 if(toupper(s1[c]) != toupper(s2[c]))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
50 return !0;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
51 c++;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
52 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
53 return 0;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
54 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
55
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
56 char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
57 long i;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
58 int found = 0;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
59 int taglen = strlen(tag)+1; /* +1 for the = we append */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
60 char *fulltag = (char *)alloca(taglen+ 1);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
61
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
62 strcpy(fulltag, tag);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
63 strcat(fulltag, "=");
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
64
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
65 for(i=0;i<vc->comments;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
66 if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
67 if(count == found)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
68 /* We return a pointer to the data, not a copy */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
69 return vc->user_comments[i] + taglen;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
70 else
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
71 found++;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
72 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
73 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
74 return NULL; /* didn't find anything */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
75 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
76
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
77 int vorbis_comment_query_count(vorbis_comment *vc, char *tag){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
78 int i,count=0;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
79 int taglen = strlen(tag)+1; /* +1 for the = we append */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
80 char *fulltag = (char *)alloca(taglen+1);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
81 strcpy(fulltag,tag);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
82 strcat(fulltag, "=");
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
83
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
84 for(i=0;i<vc->comments;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
85 if(!tagcompare(vc->user_comments[i], fulltag, taglen))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
86 count++;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
87 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
88
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
89 return count;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
90 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
91
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
92 void vorbis_comment_clear(vorbis_comment *vc){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
93 if(vc){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
94 long i;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
95 for(i=0;i<vc->comments;i++)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
96 if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
97 if(vc->user_comments)_ogg_free(vc->user_comments);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
98 if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
99 if(vc->vendor)_ogg_free(vc->vendor);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
100 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
101 memset(vc,0,sizeof(*vc));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
102 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
103
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
104 /* blocksize 0 is guaranteed to be short, 1 is guarantted to be long.
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
105 They may be equal, but short will never ge greater than long */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
106 int vorbis_info_blocksize(vorbis_info *vi,int zo){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
107 codec_setup_info *ci = (codec_setup_info *)vi->codec_setup;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
108 return ci ? ci->blocksizes[zo] : -1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
109 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
110
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
111 /* used by synthesis, which has a full, alloced vi */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
112 void vorbis_info_init(vorbis_info *vi){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
113 memset(vi,0,sizeof(*vi));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
114 vi->codec_setup=(codec_setup_info *)_ogg_calloc(1,sizeof(codec_setup_info));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
115 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
116
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
117 void vorbis_info_clear(vorbis_info *vi){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
118 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
119 int i;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
120
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
121 if(ci){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
122
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
123 for(i=0;i<ci->modes;i++)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
124 if(ci->mode_param[i])_ogg_free(ci->mode_param[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
125
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
126 for(i=0;i<ci->maps;i++) /* unpack does the range checking */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
127 _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
128
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
129 for(i=0;i<ci->floors;i++) /* unpack does the range checking */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
130 _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
131
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
132 for(i=0;i<ci->residues;i++) /* unpack does the range checking */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
133 _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
134
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
135 for(i=0;i<ci->books;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
136 if(ci->book_param[i]){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
137 /* knows if the book was not alloced */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
138 vorbis_staticbook_destroy(ci->book_param[i]);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
139 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
140 if(ci->fullbooks)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
141 vorbis_book_clear(ci->fullbooks+i);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
142 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
143 if(ci->fullbooks)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
144 _ogg_free(ci->fullbooks);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
145
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
146 _ogg_free(ci);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
147 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
148
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
149 memset(vi,0,sizeof(*vi));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
150 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
151
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
152 /* Header packing/unpacking ********************************************/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
153
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
154 static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
155 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
156 if(!ci)return(OV_EFAULT);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
157
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
158 vi->version=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
159 if(vi->version!=0)return(OV_EVERSION);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
160
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
161 vi->channels=oggpack_read(opb,8);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
162 vi->rate=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
163
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
164 vi->bitrate_upper=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
165 vi->bitrate_nominal=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
166 vi->bitrate_lower=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
167
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
168 ci->blocksizes[0]=1<<oggpack_read(opb,4);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
169 ci->blocksizes[1]=1<<oggpack_read(opb,4);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
170
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
171 if(vi->rate<1)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
172 if(vi->channels<1)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
173 if(ci->blocksizes[0]<64)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
174 if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
175 if(ci->blocksizes[1]>8192)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
176
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
177 if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
178
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
179 return(0);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
180 err_out:
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
181 vorbis_info_clear(vi);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
182 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
183 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
184
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
185 static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
186 int i;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
187 int vendorlen=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
188 if(vendorlen<0)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
189 vc->vendor=(char *)_ogg_calloc(vendorlen+1,1);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
190 _v_readstring(opb,vc->vendor,vendorlen);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
191 vc->comments=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
192 if(vc->comments<0)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
193 vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
194 vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
195
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
196 for(i=0;i<vc->comments;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
197 int len=oggpack_read(opb,32);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
198 if(len<0)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
199 vc->comment_lengths[i]=len;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
200 vc->user_comments[i]=(char *)_ogg_calloc(len+1,1);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
201 _v_readstring(opb,vc->user_comments[i],len);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
202 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
203 if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
204
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
205 return(0);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
206 err_out:
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
207 vorbis_comment_clear(vc);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
208 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
209 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
210
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
211 /* all of the real encoding details are here. The modes, books,
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
212 everything */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
213 static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
214 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
215 int i;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
216 if(!ci)return(OV_EFAULT);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
217
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
218 /* codebooks */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
219 ci->books=oggpack_read(opb,8)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
220 /*ci->book_param=_ogg_calloc(ci->books,sizeof(*ci->book_param));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
221 for(i=0;i<ci->books;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
222 ci->book_param[i]=(static_codebook *)_ogg_calloc(1,sizeof(*ci->book_param[i]));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
223 if(vorbis_staticbook_unpack(opb,ci->book_param[i]))goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
224 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
225
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
226 /* time backend settings */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
227 ci->times=oggpack_read(opb,6)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
228 /*ci->time_type=_ogg_malloc(ci->times*sizeof(*ci->time_type));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
229 /*ci->time_param=_ogg_calloc(ci->times,sizeof(void *));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
230 for(i=0;i<ci->times;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
231 ci->time_type[i]=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
232 if(ci->time_type[i]<0 || ci->time_type[i]>=VI_TIMEB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
233 /* ci->time_param[i]=_time_P[ci->time_type[i]]->unpack(vi,opb);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
234 Vorbis I has no time backend */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
235 /*if(!ci->time_param[i])goto err_out;*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
236 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
237
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
238 /* floor backend settings */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
239 ci->floors=oggpack_read(opb,6)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
240 /*ci->floor_type=_ogg_malloc(ci->floors*sizeof(*ci->floor_type));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
241 /*ci->floor_param=_ogg_calloc(ci->floors,sizeof(void *));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
242 for(i=0;i<ci->floors;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
243 ci->floor_type[i]=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
244 if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
245 ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
246 if(!ci->floor_param[i])goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
247 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
248
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
249 /* residue backend settings */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
250 ci->residues=oggpack_read(opb,6)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
251 /*ci->residue_type=_ogg_malloc(ci->residues*sizeof(*ci->residue_type));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
252 /*ci->residue_param=_ogg_calloc(ci->residues,sizeof(void *));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
253 for(i=0;i<ci->residues;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
254 ci->residue_type[i]=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
255 if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
256 ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
257 if(!ci->residue_param[i])goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
258 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
259
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
260 /* map backend settings */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
261 ci->maps=oggpack_read(opb,6)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
262 /*ci->map_type=_ogg_malloc(ci->maps*sizeof(*ci->map_type));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
263 /*ci->map_param=_ogg_calloc(ci->maps,sizeof(void *));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
264 for(i=0;i<ci->maps;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
265 ci->map_type[i]=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
266 if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
267 ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
268 if(!ci->map_param[i])goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
269 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
270
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
271 /* mode settings */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
272 ci->modes=oggpack_read(opb,6)+1;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
273 /*vi->mode_param=_ogg_calloc(vi->modes,sizeof(void *));*/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
274 for(i=0;i<ci->modes;i++){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
275 ci->mode_param[i]=(vorbis_info_mode *)_ogg_calloc(1,sizeof(*ci->mode_param[i]));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
276 ci->mode_param[i]->blockflag=oggpack_read(opb,1);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
277 ci->mode_param[i]->windowtype=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
278 ci->mode_param[i]->transformtype=oggpack_read(opb,16);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
279 ci->mode_param[i]->mapping=oggpack_read(opb,8);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
280
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
281 if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
282 if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
283 if(ci->mode_param[i]->mapping>=ci->maps)goto err_out;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
284 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
285
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
286 if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
287
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
288 return(0);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
289 err_out:
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
290 vorbis_info_clear(vi);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
291 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
292 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
293
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
294 /* The Vorbis header is in three packets; the initial small packet in
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
295 the first page that identifies basic parameters, a second packet
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
296 with bitstream comments and a third packet that holds the
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
297 codebook. */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
298
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
299 int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
300 oggpack_buffer opb;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
301
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
302 if(op){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
303 oggpack_readinit(&opb,op->packet,op->bytes);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
304
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
305 /* Which of the three types of header is this? */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
306 /* Also verify header-ness, vorbis */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
307 {
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
308 char buffer[6];
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
309 int packtype=oggpack_read(&opb,8);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
310 memset(buffer,0,6);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
311 _v_readstring(&opb,buffer,6);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
312 if(memcmp(buffer,"vorbis",6)){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
313 /* not a vorbis header */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
314 return(OV_ENOTVORBIS);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
315 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
316 switch(packtype){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
317 case 0x01: /* least significant *bit* is read first */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
318 if(!op->b_o_s){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
319 /* Not the initial packet */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
320 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
321 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
322 if(vi->rate!=0){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
323 /* previously initialized info header */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
324 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
325 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
326
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
327 return(_vorbis_unpack_info(vi,&opb));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
328
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
329 case 0x03: /* least significant *bit* is read first */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
330 if(vi->rate==0){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
331 /* um... we didn't get the initial header */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
332 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
333 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
334
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
335 return(_vorbis_unpack_comment(vc,&opb));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
336
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
337 case 0x05: /* least significant *bit* is read first */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
338 if(vi->rate==0 || vc->vendor==NULL){
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
339 /* um... we didn;t get the initial header or comments yet */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
340 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
341 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
342
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
343 return(_vorbis_unpack_books(vi,&opb));
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
344
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
345 default:
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
346 /* Not a valid vorbis header type */
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
347 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
348 break;
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
349 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
350 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
351 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
352 return(OV_EBADHEADER);
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
353 }
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
354