Fixed code from commit r2103, so it actually works...

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2107 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-09-22 08:57:46 +00:00
parent a657db1569
commit 0584c497db

View File

@ -65,9 +65,12 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
if (PresentationTimeStampDecodeTimeStampFlags == Helper.B00000010 ||
PresentationTimeStampDecodeTimeStampFlags == Helper.B00000011)
{
ulong pts = (ulong)(((buffer[tempIndex + 3]) << 7) + ((buffer[tempIndex + 4] & Helper.B11111110) >> 1));
pts += (ulong)(((buffer[tempIndex + 1]) << 7) + (buffer[tempIndex + 2] >> 1)) << 15;
pts += (ulong)((buffer[tempIndex] & Helper.B00001110) << 29);
PresentationTimeStamp = (ulong)buffer[tempIndex + 4] >> 1;
PresentationTimeStamp += (ulong)buffer[tempIndex + 3] << 7;
PresentationTimeStamp += (ulong)(buffer[tempIndex + 2] & Helper.B11111110) << 14;
PresentationTimeStamp += (ulong)buffer[tempIndex + 1] << 22;
PresentationTimeStamp += (ulong)(buffer[tempIndex + 0] & Helper.B00001110) << 29;
//string bString = Helper.GetBinaryString(buffer, tempIndex, 5);
//bString = bString.Substring(4, 3) + bString.Substring(8, 15) + bString.Substring(24, 15);
//PresentationTimeStamp = Convert.ToUInt64(bString, 2);
@ -78,9 +81,12 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
//string bString = Helper.GetBinaryString(buffer, tempIndex, 5);
//bString = bString.Substring(4, 3) + bString.Substring(8, 15) + bString.Substring(24, 15);
//DecodeTimeStamp = Convert.ToUInt64(bString, 2);
ulong dts = (ulong)(((buffer[tempIndex + 3]) << 7) + ((buffer[tempIndex + 4] & Helper.B11111110) >> 1));
dts += (ulong)(((buffer[tempIndex + 1]) << 7) + (buffer[tempIndex + 2] >> 1)) << 15;
dts += (ulong)((buffer[tempIndex] & Helper.B00001110) << 29);
DecodeTimeStamp = (ulong)buffer[tempIndex + 4] >> 1;
DecodeTimeStamp += (ulong)buffer[tempIndex + 3] << 7;
DecodeTimeStamp += (ulong)(buffer[tempIndex + 2] & Helper.B11111110) << 14;
DecodeTimeStamp += (ulong)buffer[tempIndex + 1] << 22;
DecodeTimeStamp += (ulong)(buffer[tempIndex + 0] & Helper.B00001110) << 29;
}
int dataIndex = index + HeaderDataLength + 24 - Mpeg2Header.Length;