}
static int
-_commentheader_out (vorbis_comment *vc, char *vendor, ogg_packet *op)
+_commentheader_out (vcedit_state *s, ogg_packet *op)
{
- int i;
-
oggpack_buffer opb;
+ size_t len;
+ int i;
oggpack_writeinit (&opb);
_v_writestring (&opb, "vorbis", 6);
/* vendor */
- oggpack_write (&opb, strlen (vendor), 32);
- _v_writestring (&opb, vendor, strlen (vendor));
+ len = strlen (s->vendor);
+ oggpack_write (&opb, len, 32);
+ _v_writestring (&opb, s->vendor, len);
/* comments */
- oggpack_write (&opb, vc->comments, 32);
+ oggpack_write (&opb, s->vc.comments, 32);
- for (i = 0; i < vc->comments; i++) {
- if (!vc->user_comments[i])
+ for (i = 0; i < s->vc.comments; i++) {
+ if (!s->vc.user_comments[i])
oggpack_write (&opb, 0, 32);
else {
- oggpack_write (&opb, vc->comment_lengths[i], 32);
- _v_writestring (&opb, vc->user_comments[i],
- vc->comment_lengths[i]);
+ oggpack_write (&opb, s->vc.comment_lengths[i], 32);
+ _v_writestring (&opb, s->vc.user_comments[i],
+ s->vc.comment_lengths[i]);
}
}
ogg_stream_init (&streamout, s->serial);
- _commentheader_out (&s->vc, s->vendor, &header_comments);
+ _commentheader_out (s, &header_comments);
ogg_stream_packetin (&streamout, &header_main);
ogg_stream_packetin (&streamout, &header_comments);