Commit 31e1be75 authored by Max Kellermann's avatar Max Kellermann

encoder/opus: call ogg_stream_flush() only in the last iteration

If there are multiple pages, the last partial page must be flushed.
parent d793b7c0
......@@ -371,12 +371,12 @@ opus_encoder_read(struct encoder *_encoder, void *_dest, size_t length)
opus_encoder_generate_tags(encoder);
ogg_page page;
int result;
if (encoder->flush) {
int result = ogg_stream_pageout(&encoder->os, &page);
if (result == 0 && encoder->flush) {
encoder->flush = false;
result = ogg_stream_flush(&encoder->os, &page);
} else
result = ogg_stream_pageout(&encoder->os, &page);
}
if (result == 0)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment