aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder/OpusEncoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoder/OpusEncoderPlugin.cxx')
-rw-r--r--src/encoder/OpusEncoderPlugin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/encoder/OpusEncoderPlugin.cxx b/src/encoder/OpusEncoderPlugin.cxx
index c967a24a7..4a51dabb3 100644
--- a/src/encoder/OpusEncoderPlugin.cxx
+++ b/src/encoder/OpusEncoderPlugin.cxx
@@ -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;