mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Merge pull request #1934 from ivandrofly/dvdsubpes
[DvdSubPes] - Working on #1932.
This commit is contained in:
commit
e7df9cd27e
@ -59,7 +59,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
|
||||
HeaderDataLength = buffer[index + 8];
|
||||
|
||||
if (buffer.Length < index + 9 + HeaderDataLength)
|
||||
if (buffer.Length <= index + 9 + HeaderDataLength)
|
||||
return;
|
||||
|
||||
if (StreamId == 0xBD) // 10111101 binary = 189 decimal = 0xBD hex -> private_stream_1
|
||||
@ -68,10 +68,10 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
if (id >= 0x20 && id <= 0x40) // x3f 0r x40 ?
|
||||
SubPictureStreamId = id;
|
||||
}
|
||||
|
||||
if (index + 9 + 4 < buffer.Length)
|
||||
{
|
||||
int tempIndex = index + 9;
|
||||
if (PresentationTimestampDecodeTimestampFlags == Helper.B00000010 ||
|
||||
PresentationTimestampDecodeTimestampFlags == Helper.B00000011)
|
||||
if (PresentationTimestampDecodeTimestampFlags == Helper.B00000010 || PresentationTimestampDecodeTimestampFlags == Helper.B00000011)
|
||||
{
|
||||
PresentationTimestamp = (ulong)buffer[tempIndex + 4] >> 1;
|
||||
PresentationTimestamp += (ulong)buffer[tempIndex + 3] << 7;
|
||||
@ -87,7 +87,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
DecodeTimestamp += (ulong)buffer[tempIndex + 1] << 22;
|
||||
DecodeTimestamp += (ulong)(buffer[tempIndex + 0] & Helper.B00001110) << 29;
|
||||
}
|
||||
|
||||
}
|
||||
int dataIndex = index + HeaderDataLength + 24 - Mpeg2HeaderLength;
|
||||
int dataSize = Length - (4 + HeaderDataLength);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user