Always flush when encountering a new key packet

This commit is contained in:
Vanilagy
2025-06-18 14:27:17 +02:00
parent d5671fd8ad
commit eef573a972
-4
View File
@@ -581,12 +581,8 @@ export abstract class BaseMediaSampleSink<
) )
) { ) {
await decodePackets(); await decodePackets();
if (targetPacket.timestamp < lastPacket.timestamp) {
// We're going back in time with this one, let's flush and reset to a clean state
await flushDecoder(); await flushDecoder();
} }
}
timestampsOfInterest.push(targetPacket.timestamp); timestampsOfInterest.push(targetPacket.timestamp);
maxSequenceNumber = Math.max(targetPacket.sequenceNumber, maxSequenceNumber); maxSequenceNumber = Math.max(targetPacket.sequenceNumber, maxSequenceNumber);