Code cleanup.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 19 Aug 2006 20:43:25 +0000 (22:43 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Wed, 23 Aug 2006 17:39:16 +0000 (19:39 +0200)
ext/vcedit.c

index 32778a3e735b6e1e14cfb1bab060d7bc203953ee..7a7797a372b6680e000311979233b3aa15c25de2 100644 (file)
@@ -121,7 +121,7 @@ vcedit_state_new (const char *filename)
        if (len > PATH_MAX)
                return NULL;
 
-       s= malloc (sizeof (vcedit_state) + len + 1);
+       s = malloc (sizeof (vcedit_state) + len + 1);
        if (!s)
                return NULL;
 
@@ -211,7 +211,7 @@ write_comments (vcedit_state *s, ogg_packet *packet)
        /* 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 {
@@ -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]);
                }
-       }
 
        oggpack_write (&opb, 1, 1);
 
@@ -501,11 +500,10 @@ vcedit_write (vcedit_state *s)
                size = _blocksize (s, &packet);
                granpos += size;
 
-               if (need_flush) {
+               if (need_flush)
                        write = ogg_stream_flush (&stream, &page_out);
-               } else if (need_out) {
+               else if (need_out)
                        write = ogg_stream_pageout (&stream, &page_out);
-               }
 
                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.
                 */
-               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;
-               }
 
                buffer = ogg_sync_buffer (&s->oy, CHUNKSIZE);
                bytes = fread (buffer, 1, CHUNKSIZE, s->in);