mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Merge pull request #1944 from MellowArpeggiation/main
Fix #1943 - Duplicate frames being skipped when decoding Theora
This commit is contained in:
@@ -232,14 +232,18 @@ void TheoraVideoStream::threadedFillBackBuffer(double dt)
|
|||||||
th_decode_ycbcr_out(decoder, bufferinfo);
|
th_decode_ycbcr_out(decoder, bufferinfo);
|
||||||
hasFrame = true;
|
hasFrame = true;
|
||||||
|
|
||||||
ogg_int64_t granulePosition;
|
ogg_int64_t decoderPosition;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (demuxer.readPacket(packet))
|
if (demuxer.readPacket(packet))
|
||||||
return;
|
return;
|
||||||
} while (th_decode_packetin(decoder, &packet, &granulePosition) != 0);
|
|
||||||
|
if (packet.granulepos > 0)
|
||||||
|
th_decode_ctl(decoder, TH_DECCTL_SET_GRANPOS, &packet.granulepos, sizeof(packet.granulepos));
|
||||||
|
} while (th_decode_packetin(decoder, &packet, &decoderPosition) != 0);
|
||||||
|
|
||||||
lastFrame = nextFrame;
|
lastFrame = nextFrame;
|
||||||
nextFrame = th_granule_time(decoder, granulePosition);
|
nextFrame = th_granule_time(decoder, decoderPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only swap once, even if we read many frames to get here
|
// Only swap once, even if we read many frames to get here
|
||||||
|
|||||||
Reference in New Issue
Block a user