Set discontinuity_indicator to 1 for the first packet

This commit is contained in:
Vanilagy
2026-01-16 16:56:50 +01:00
parent e8b27768a9
commit 282751ec1c
3 changed files with 21 additions and 14 deletions
+4 -5
View File
@@ -638,10 +638,6 @@ const readPesPacketHeader = (section: Section): PesPacketHeader | null => {
bitstream.skipBits(14);
if (ptsDtsFlags !== 0b10 && ptsDtsFlags !== 0b11) {
return null; // Support only timestamped packets
}
let pts = 0;
if (ptsDtsFlags === 0b10 || ptsDtsFlags === 0b11) {
bitstream.skipBits(4);
@@ -651,7 +647,10 @@ const readPesPacketHeader = (section: Section): PesPacketHeader | null => {
bitstream.skipBits(1);
pts += bitstream.readBits(15);
} else {
return null; // Support only timestamped packets
throw new Error(
'PES packets without PTS are not currently supported. If you think this file should be supported,'
+ ' please report it.',
);
}
return {