mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Fix faulty MPEG-2 detection (fixes #322)
This commit is contained in:
+1
-1
@@ -530,7 +530,7 @@ export class MpegTsInputFormat extends InputFormat {
|
||||
} else if (bytes[0] === 0x47 && bytes[TS_PACKET_SIZE + 16] === 0x47) {
|
||||
// MPEG-TS with Forward Error Correction
|
||||
return true;
|
||||
} else if (bytes[4] === 0x47 && bytes[4 + TS_PACKET_SIZE] === 0x47) {
|
||||
} else if (bytes[4] === 0x47 && bytes[4 + TS_PACKET_SIZE + 4] === 0x47) {
|
||||
// MPEG-2-TS (DVHS)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -161,10 +161,10 @@ export class MpegTsDemuxer extends Demuxer {
|
||||
// MPEG-TS with Forward Error Correction
|
||||
this.packetOffset = 0;
|
||||
this.packetStride = TS_PACKET_SIZE + 16;
|
||||
} else if (startingBytes[4] === 0x47 && startingBytes[4 + TS_PACKET_SIZE] === 0x47) {
|
||||
} else if (startingBytes[4] === 0x47 && startingBytes[4 + TS_PACKET_SIZE + 4] === 0x47) {
|
||||
// MPEG-2-TS (DVHS)
|
||||
this.packetOffset = 4;
|
||||
this.packetStride = TS_PACKET_SIZE;
|
||||
this.packetStride = TS_PACKET_SIZE + 4;
|
||||
} else {
|
||||
throw new Error('Unreachable.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user