From 8dd7cc16abd05109303260715d179acc0a79f50e Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Tue, 29 Mar 2016 22:43:20 +0200 Subject: [PATCH] Fix end-of-stream detection for videos Fixes hang when a video file contains frames past the end of the video stream --- src/modules/video/theora/VideoStream.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/video/theora/VideoStream.cpp b/src/modules/video/theora/VideoStream.cpp index 12dbca8bc..4d3d3354a 100644 --- a/src/modules/video/theora/VideoStream.cpp +++ b/src/modules/video/theora/VideoStream.cpp @@ -151,12 +151,12 @@ bool VideoStream::readPacket(bool mustSucceed) while (ogg_stream_packetout(&stream, &packet) != 1) { - // We need to read another page, but there is none, we're at the end - if (ogg_page_eos(&page) && !mustSucceed) - return eos = true; - do { + // We need to read another page, but there is none, we're at the end + if (ogg_page_eos(&page) && !mustSucceed) + return eos = true; + readPage(); } while (ogg_page_serialno(&page) != videoSerial);