projects
/
ruby-vorbistagger.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code cleanup.
[ruby-vorbistagger.git]
/
ext
/
vcedit.c
diff --git
a/ext/vcedit.c
b/ext/vcedit.c
index 32778a3e735b6e1e14cfb1bab060d7bc203953ee..7a7797a372b6680e000311979233b3aa15c25de2 100644
(file)
--- a/
ext/vcedit.c
+++ b/
ext/vcedit.c
@@
-121,7
+121,7
@@
vcedit_state_new (const char *filename)
if (len > PATH_MAX)
return NULL;
if (len > PATH_MAX)
return NULL;
- s= malloc (sizeof (vcedit_state) + len + 1);
+ s
= malloc (sizeof (vcedit_state) + len + 1);
if (!s)
return NULL;
if (!s)
return NULL;
@@
-211,7
+211,7
@@
write_comments (vcedit_state *s, ogg_packet *packet)
/* comments */
oggpack_write (&opb, s->vc.comments, 32);
/* comments */
oggpack_write (&opb, s->vc.comments, 32);
- for (i = 0; i < s->vc.comments; i++)
{
+ for (i = 0; i < s->vc.comments; i++)
if (!s->vc.user_comments[i])
oggpack_write (&opb, 0, 32);
else {
if (!s->vc.user_comments[i])
oggpack_write (&opb, 0, 32);
else {
@@
-219,7
+219,6
@@
write_comments (vcedit_state *s, ogg_packet *packet)
_v_writestring (&opb, s->vc.user_comments[i],
s->vc.comment_lengths[i]);
}
_v_writestring (&opb, s->vc.user_comments[i],
s->vc.comment_lengths[i]);
}
- }
oggpack_write (&opb, 1, 1);
oggpack_write (&opb, 1, 1);
@@
-501,11
+500,10
@@
vcedit_write (vcedit_state *s)
size = _blocksize (s, &packet);
granpos += size;
size = _blocksize (s, &packet);
granpos += size;
- if (need_flush)
{
+ if (need_flush)
write = ogg_stream_flush (&stream, &page_out);
write = ogg_stream_flush (&stream, &page_out);
- } else if (need_out) {
+ else if (need_out)
write = ogg_stream_pageout (&stream, &page_out);
write = ogg_stream_pageout (&stream, &page_out);
- }
if (write && !write_page (out, &page_out))
goto cleanup;
if (write && !write_page (out, &page_out))
goto cleanup;
@@
-546,13
+544,9
@@
vcedit_write (vcedit_state *s)
/* We copy the rest of the stream (other logical streams)
* through, a page at a time.
*/
/* We copy the rest of the stream (other logical streams)
* through, a page at a time.
*/
- while ((result = ogg_sync_pageout (&s->oy, &page_out))) {
- /* Don't bother going through the rest, we can just
- * write the page out now
- */
+ while ((result = ogg_sync_pageout (&s->oy, &page_out)))
if (result == 1 && !write_page (out, &page_out))
goto cleanup;
if (result == 1 && !write_page (out, &page_out))
goto cleanup;
- }
buffer = ogg_sync_buffer (&s->oy, CHUNKSIZE);
bytes = fread (buffer, 1, CHUNKSIZE, s->in);
buffer = ogg_sync_buffer (&s->oy, CHUNKSIZE);
bytes = fread (buffer, 1, CHUNKSIZE, s->in);