- if (!result)
- break;
-
- if (result < 0)
- state->lasterror = "Corrupt or missing data, continuing...";
- else {
- /* Don't bother going through the rest, we can just
- * write the page out now
- */
- tmp = fwrite (ogout.header, 1, ogout.header_len, out);
- if (tmp != (size_t) ogout.header_len)
- goto cleanup;
-
- tmp = fwrite (ogout.body, 1, ogout.body_len, out);
- if (tmp != (size_t) ogout.body_len)
- goto cleanup;
- }
- }
-
- buffer = ogg_sync_buffer (state->oy, CHUNKSIZE);
- bytes = fread (buffer, 1, CHUNKSIZE, state->in);
- ogg_sync_wrote (state->oy, bytes);
-
- if (!bytes) {
- state->eosin = 1;
- break;
- }
- }
+ buffer = ogg_sync_buffer (&s->oy, CHUNKSIZE);
+ bytes = fread (buffer, 1, CHUNKSIZE, s->in);
+ ogg_sync_wrote (&s->oy, bytes);