mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fixed bug in TS parser
This commit is contained in:
parent
40161d40fd
commit
c2a9287bb2
@ -61,8 +61,8 @@ namespace Nikse.SubtitleEdit.Logic.TransportStream
|
||||
PcrFlag = (packetBuffer[5] & 16) > 0; // and with 00010000 to get fourth byte
|
||||
OpcrFlag = (packetBuffer[5] & 8) > 0; // and with 00001000 to get fifth byte
|
||||
SplicingPointFlag = (packetBuffer[5] & 4) > 0; // and with 00000100 to get sixth byte
|
||||
TransportPrivateDataFlag = (packetBuffer[5] & 2) > 0; // and with 00000100 to get seventh byte
|
||||
AdaptationFieldExtensionFlag = (packetBuffer[5] & 1) > 0; // and with 00000010 to get 8th byte
|
||||
TransportPrivateDataFlag = (packetBuffer[5] & 4) > 0; // and with 00000100 to get seventh byte
|
||||
AdaptationFieldExtensionFlag = (packetBuffer[5] & 2) > 0; // and with 00000010 to get 8th byte
|
||||
|
||||
int index = 6;
|
||||
if (PcrFlag)
|
||||
@ -92,9 +92,13 @@ namespace Nikse.SubtitleEdit.Logic.TransportStream
|
||||
TransportPrivateDataLength = packetBuffer[index];
|
||||
index++;
|
||||
TransportPrivateData = new byte[TransportPrivateDataLength];
|
||||
|
||||
if (index + TransportPrivateDataLength <= packetBuffer.Length)
|
||||
{
|
||||
Buffer.BlockCopy(packetBuffer, index, TransportPrivateData, 0, TransportPrivateDataLength);
|
||||
index += TransportPrivateDataLength;
|
||||
}
|
||||
}
|
||||
|
||||
if (AdaptationFieldExtensionFlag)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user