projects
/
ruby-vorbistagger.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
42092cf
)
Code cleanup.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Fri, 18 Aug 2006 13:49:38 +0000
(15:49 +0200)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Wed, 23 Aug 2006 17:39:15 +0000
(19:39 +0200)
ext/vcedit.c
patch
|
blob
|
history
diff --git
a/ext/vcedit.c
b/ext/vcedit.c
index 38ecb9f9d384818c84df6a0e96b85274fdd34767..7976a066f4e5409fd5945617d6ec386fa4439cd2 100644
(file)
--- a/
ext/vcedit.c
+++ b/
ext/vcedit.c
@@
-163,11
+163,11
@@
_v_writestring (oggpack_buffer *o, char *s, int len)
}
static int
}
static int
-_commentheader_out (v
orbis_comment *vc, char *vendor
, ogg_packet *op)
+_commentheader_out (v
cedit_state *s
, ogg_packet *op)
{
{
- int i;
-
oggpack_buffer opb;
oggpack_buffer opb;
+ size_t len;
+ int i;
oggpack_writeinit (&opb);
oggpack_writeinit (&opb);
@@
-176,19
+176,20
@@
_commentheader_out (vorbis_comment *vc, char *vendor, ogg_packet *op)
_v_writestring (&opb, "vorbis", 6);
/* vendor */
_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 */
/* 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, 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]);
}
}
}
}
@@
-440,7
+441,7
@@
vcedit_write (vcedit_state *s)
ogg_stream_init (&streamout, s->serial);
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);
ogg_stream_packetin (&streamout, &header_main);
ogg_stream_packetin (&streamout, &header_comments);