From a6301d45f4a347e068414e6075be2e5f87eef948 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 8 Jan 2013 01:05:59 +0100 Subject: decoder/Opus: use OggExpectPage() in main loop --- src/decoder/OpusDecoderPlugin.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx index c48b2afa5..27bd702fa 100644 --- a/src/decoder/OpusDecoderPlugin.cxx +++ b/src/decoder/OpusDecoderPlugin.cxx @@ -250,15 +250,13 @@ mpd_opus_stream_decode(struct decoder *decoder, ogg_sync_init(&oy); while (true) { - if (!OggFeed(oy, decoder, input_stream, 1024)) + ogg_page page; + if (!OggExpectPage(oy, page, decoder, input_stream)) break; - ogg_page page; - while (ogg_sync_pageout(&oy, &page) == 1) { - enum decoder_command cmd = d.HandlePage(page); - if (cmd != DECODE_COMMAND_NONE) - break; - } + enum decoder_command cmd = d.HandlePage(page); + if (cmd != DECODE_COMMAND_NONE) + break; } ogg_sync_clear(&oy); -- cgit v1.2.3