diff options
Diffstat (limited to 'apps/codecs/libtremor/info.c')
-rw-r--r-- | apps/codecs/libtremor/info.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index afa9497cf0..935fa03269 100644 --- a/apps/codecs/libtremor/info.c +++ b/apps/codecs/libtremor/info.c | |||
@@ -47,7 +47,7 @@ void vorbis_comment_clear(vorbis_comment *vc){ | |||
47 | for(i=0;i<vc->comments;i++) | 47 | for(i=0;i<vc->comments;i++) |
48 | if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); | 48 | if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); |
49 | if(vc->user_comments)_ogg_free(vc->user_comments); | 49 | if(vc->user_comments)_ogg_free(vc->user_comments); |
50 | if(vc->comment_lengths)_ogg_free(vc->comment_lengths); | 50 | if(vc->comment_lengths)_ogg_free(vc->comment_lengths); |
51 | if(vc->vendor)_ogg_free(vc->vendor); | 51 | if(vc->vendor)_ogg_free(vc->vendor); |
52 | memset(vc,0,sizeof(*vc)); | 52 | memset(vc,0,sizeof(*vc)); |
53 | } | 53 | } |
@@ -77,26 +77,26 @@ void vorbis_info_clear(vorbis_info *vi){ | |||
77 | 77 | ||
78 | for(i=0;i<ci->maps;i++) /* unpack does the range checking */ | 78 | for(i=0;i<ci->maps;i++) /* unpack does the range checking */ |
79 | if(ci->map_param[i]) | 79 | if(ci->map_param[i]) |
80 | _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); | 80 | _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); |
81 | 81 | ||
82 | for(i=0;i<ci->floors;i++) /* unpack does the range checking */ | 82 | for(i=0;i<ci->floors;i++) /* unpack does the range checking */ |
83 | if(ci->floor_param[i]) | 83 | if(ci->floor_param[i]) |
84 | _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); | 84 | _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); |
85 | 85 | ||
86 | for(i=0;i<ci->residues;i++) /* unpack does the range checking */ | 86 | for(i=0;i<ci->residues;i++) /* unpack does the range checking */ |
87 | if(ci->residue_param[i]) | 87 | if(ci->residue_param[i]) |
88 | _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); | 88 | _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); |
89 | 89 | ||
90 | for(i=0;i<ci->books;i++){ | 90 | for(i=0;i<ci->books;i++){ |
91 | if(ci->book_param[i]){ | 91 | if(ci->book_param[i]){ |
92 | /* knows if the book was not alloced */ | 92 | /* knows if the book was not alloced */ |
93 | vorbis_staticbook_destroy(ci->book_param[i]); | 93 | vorbis_staticbook_destroy(ci->book_param[i]); |
94 | } | 94 | } |
95 | if(ci->fullbooks) | 95 | if(ci->fullbooks) |
96 | vorbis_book_clear(ci->fullbooks+i); | 96 | vorbis_book_clear(ci->fullbooks+i); |
97 | } | 97 | } |
98 | if(ci->fullbooks) | 98 | if(ci->fullbooks) |
99 | _ogg_free(ci->fullbooks); | 99 | _ogg_free(ci->fullbooks); |
100 | 100 | ||
101 | _ogg_free(ci); | 101 | _ogg_free(ci); |
102 | } | 102 | } |
@@ -278,42 +278,42 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op) | |||
278 | memset(buffer,0,6); | 278 | memset(buffer,0,6); |
279 | _v_readstring(&opb,buffer,6); | 279 | _v_readstring(&opb,buffer,6); |
280 | if(memcmp(buffer,"vorbis",6)){ | 280 | if(memcmp(buffer,"vorbis",6)){ |
281 | /* not a vorbis header */ | 281 | /* not a vorbis header */ |
282 | return(OV_ENOTVORBIS); | 282 | return(OV_ENOTVORBIS); |
283 | } | 283 | } |
284 | switch(packtype){ | 284 | switch(packtype){ |
285 | case 0x01: /* least significant *bit* is read first */ | 285 | case 0x01: /* least significant *bit* is read first */ |
286 | if(!op->b_o_s){ | 286 | if(!op->b_o_s){ |
287 | /* Not the initial packet */ | 287 | /* Not the initial packet */ |
288 | return(OV_EBADHEADER); | 288 | return(OV_EBADHEADER); |
289 | } | 289 | } |
290 | if(vi->rate!=0){ | 290 | if(vi->rate!=0){ |
291 | /* previously initialized info header */ | 291 | /* previously initialized info header */ |
292 | return(OV_EBADHEADER); | 292 | return(OV_EBADHEADER); |
293 | } | 293 | } |
294 | 294 | ||
295 | return(_vorbis_unpack_info(vi,&opb)); | 295 | return(_vorbis_unpack_info(vi,&opb)); |
296 | 296 | ||
297 | case 0x03: /* least significant *bit* is read first */ | 297 | case 0x03: /* least significant *bit* is read first */ |
298 | if(vi->rate==0){ | 298 | if(vi->rate==0){ |
299 | /* um... we didn't get the initial header */ | 299 | /* um... we didn't get the initial header */ |
300 | return(OV_EBADHEADER); | 300 | return(OV_EBADHEADER); |
301 | } | 301 | } |
302 | 302 | ||
303 | return(_vorbis_unpack_comment(vc,&opb)); | 303 | return(_vorbis_unpack_comment(vc,&opb)); |
304 | 304 | ||
305 | case 0x05: /* least significant *bit* is read first */ | 305 | case 0x05: /* least significant *bit* is read first */ |
306 | if(vi->rate==0 || vc->vendor==NULL){ | 306 | if(vi->rate==0 || vc->vendor==NULL){ |
307 | /* um... we didn;t get the initial header or comments yet */ | 307 | /* um... we didn;t get the initial header or comments yet */ |
308 | return(OV_EBADHEADER); | 308 | return(OV_EBADHEADER); |
309 | } | 309 | } |
310 | 310 | ||
311 | return(_vorbis_unpack_books(vi,&opb)); | 311 | return(_vorbis_unpack_books(vi,&opb)); |
312 | 312 | ||
313 | default: | 313 | default: |
314 | /* Not a valid vorbis header type */ | 314 | /* Not a valid vorbis header type */ |
315 | return(OV_EBADHEADER); | 315 | return(OV_EBADHEADER); |
316 | break; | 316 | break; |
317 | } | 317 | } |
318 | } | 318 | } |
319 | } | 319 | } |