Lines Matching refs:vc

61 void vorbis_comment_init(vorbis_comment *vc){  in vorbis_comment_init()  argument
62 memset(vc,0,sizeof(*vc)); in vorbis_comment_init()
65 void vorbis_comment_add(vorbis_comment *vc,const char *comment){ in vorbis_comment_add() argument
66 vc->user_comments=_ogg_realloc(vc->user_comments, in vorbis_comment_add()
67 (vc->comments+2)*sizeof(*vc->user_comments)); in vorbis_comment_add()
68 vc->comment_lengths=_ogg_realloc(vc->comment_lengths, in vorbis_comment_add()
69 (vc->comments+2)*sizeof(*vc->comment_lengths)); in vorbis_comment_add()
70 vc->comment_lengths[vc->comments]=strlen(comment); in vorbis_comment_add()
71 vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1); in vorbis_comment_add()
72 strcpy(vc->user_comments[vc->comments], comment); in vorbis_comment_add()
73 vc->comments++; in vorbis_comment_add()
74 vc->user_comments[vc->comments]=NULL; in vorbis_comment_add()
77 void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){ in vorbis_comment_add_tag() argument
82 vorbis_comment_add(vc, comment); in vorbis_comment_add_tag()
97 char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){ in vorbis_comment_query() argument
106 for(i=0;i<vc->comments;i++){ in vorbis_comment_query()
107 if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ in vorbis_comment_query()
110 return vc->user_comments[i] + taglen; in vorbis_comment_query()
118 int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){ in vorbis_comment_query_count() argument
125 for(i=0;i<vc->comments;i++){ in vorbis_comment_query_count()
126 if(!tagcompare(vc->user_comments[i], fulltag, taglen)) in vorbis_comment_query_count()
133 void vorbis_comment_clear(vorbis_comment *vc){ in vorbis_comment_clear() argument
134 if(vc){ in vorbis_comment_clear()
136 if(vc->user_comments){ in vorbis_comment_clear()
137 for(i=0;i<vc->comments;i++) in vorbis_comment_clear()
138 if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); in vorbis_comment_clear()
139 _ogg_free(vc->user_comments); in vorbis_comment_clear()
141 if(vc->comment_lengths)_ogg_free(vc->comment_lengths); in vorbis_comment_clear()
142 if(vc->vendor)_ogg_free(vc->vendor); in vorbis_comment_clear()
143 memset(vc,0,sizeof(*vc)); in vorbis_comment_clear()
240 static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ in _vorbis_unpack_comment() argument
245 vc->vendor=_ogg_calloc(vendorlen+1,1); in _vorbis_unpack_comment()
246 _v_readstring(opb,vc->vendor,vendorlen); in _vorbis_unpack_comment()
250 vc->comments=i; in _vorbis_unpack_comment()
251 vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments)); in _vorbis_unpack_comment()
252 vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths)); in _vorbis_unpack_comment()
254 for(i=0;i<vc->comments;i++){ in _vorbis_unpack_comment()
258 vc->comment_lengths[i]=len; in _vorbis_unpack_comment()
259 vc->user_comments[i]=_ogg_calloc(len+1,1); in _vorbis_unpack_comment()
260 _v_readstring(opb,vc->user_comments[i],len); in _vorbis_unpack_comment()
266 vorbis_comment_clear(vc); in _vorbis_unpack_comment()
379 int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){ in vorbis_synthesis_headerin() argument
415 return(_vorbis_unpack_comment(vc,&opb)); in vorbis_synthesis_headerin()
418 if(vi->rate==0 || vc->vendor==NULL){ in vorbis_synthesis_headerin()
461 static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){ in _vorbis_pack_comment() argument
474 oggpack_write(opb,vc->comments,32); in _vorbis_pack_comment()
475 if(vc->comments){ in _vorbis_pack_comment()
477 for(i=0;i<vc->comments;i++){ in _vorbis_pack_comment()
478 if(vc->user_comments[i]){ in _vorbis_pack_comment()
479 oggpack_write(opb,vc->comment_lengths[i],32); in _vorbis_pack_comment()
480 _v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]); in _vorbis_pack_comment()
547 int vorbis_commentheader_out(vorbis_comment *vc, in vorbis_commentheader_out() argument
553 if(_vorbis_pack_comment(&opb,vc)) return OV_EIMPL; in vorbis_commentheader_out()
568 vorbis_comment *vc, in vorbis_analysis_headerout() argument
601 if(_vorbis_pack_comment(&opb,vc))goto err_out; in vorbis_analysis_headerout()