osync = lms_create_ogg_sync();
+ vorbis_comment_init(vc);
+
while (1) {
buffer = lms_get_ogg_sync_buffer(osync, CHUNKSIZE);
bytes = fread(buffer, 1, CHUNKSIZE, file);
serial = ogg_page_serialno(&og);
os = lms_create_ogg_stream(serial);
- vorbis_comment_init(vc);
-
if (ogg_stream_pagein(os, &og) < 0 ||
ogg_stream_packetout(os, &header) != 1 ||
vorbis_synthesis_headerin(&vi, vc, &header) != 0)
end:
vorbis_info_clear(&vi);
+ if (ret)
+ vorbis_comment_clear(vc);
if (os)
lms_destroy_ogg_stream(os);