mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fix end-of-stream detection for videos
Fixes hang when a video file contains frames past the end of the video stream
This commit is contained in:
@@ -151,12 +151,12 @@ bool VideoStream::readPacket(bool mustSucceed)
|
|||||||
|
|
||||||
while (ogg_stream_packetout(&stream, &packet) != 1)
|
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
|
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();
|
readPage();
|
||||||
} while (ogg_page_serialno(&page) != videoSerial);
|
} while (ogg_page_serialno(&page) != videoSerial);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user