- state->in = in;
- state->read = read_func;
- state->write = write_func;
-
- state->oy = malloc (sizeof (ogg_sync_state));
- ogg_sync_init (state->oy);
-
- while (1) {
- buffer = ogg_sync_buffer (state->oy, CHUNKSIZE);
- bytes = state->read (buffer, 1, CHUNKSIZE, state->in);
-
- ogg_sync_wrote (state->oy, bytes);
+ state->in = fopen (state->filename, "rb");
+ if (!state->in)
+ return VCEDIT_ERR_OPEN;