From e5b0fdc34ae9f13af95b4bb0166fc00d4e00db70 Mon Sep 17 00:00:00 2001 From: niksedk Date: Fri, 20 Sep 2013 17:55:10 +0000 Subject: [PATCH] git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2102 99eadd0c-20b8-1223-b5c4-2a2b2df33de2 --- src/Logic/VobSub/Mpeg2Header.cs | 13 ++++++------- src/Logic/VobSub/VobSubParser.cs | 3 +++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Logic/VobSub/Mpeg2Header.cs b/src/Logic/VobSub/Mpeg2Header.cs index 77d684a03..22b713d20 100644 --- a/src/Logic/VobSub/Mpeg2Header.cs +++ b/src/Logic/VobSub/Mpeg2Header.cs @@ -11,7 +11,8 @@ namespace Nikse.SubtitleEdit.Logic.VobSub public readonly UInt32 StartCode; public readonly byte PackIndentifier; - public readonly UInt64 SystemClockReferenceQuotient; + //public readonly UInt64 SystemClockReferenceQuotient; + //public readonly UInt64 SystemClockReferenceRemainder; public readonly UInt64 ProgramMuxRate; public readonly int PackStuffingLength; @@ -20,13 +21,11 @@ namespace Nikse.SubtitleEdit.Logic.VobSub StartCode = Helper.GetEndian(buffer, 0, 3); PackIndentifier = buffer[3]; - string b4To9AsBinary = Helper.GetBinaryString(buffer, 4, 6); - b4To9AsBinary = b4To9AsBinary.Substring(2,3) + b4To9AsBinary.Substring(6,15) + b4To9AsBinary.Substring(22,15); - SystemClockReferenceQuotient = Helper.GetUInt32FromBinaryString(b4To9AsBinary); + //string b4To9AsBinary = Helper.GetBinaryString(buffer, 4, 6); + //b4To9AsBinary = b4To9AsBinary.Substring(2,3) + b4To9AsBinary.Substring(6,15) + b4To9AsBinary.Substring(22,15); + //SystemClockReferenceQuotient = Helper.GetUInt32FromBinaryString(b4To9AsBinary); - string b8And9 = Helper.GetBinaryString(buffer, 8, 2); - b8And9 = b8And9.Substring(6, 9); - SystemClockReferenceQuotient = Helper.GetUInt32FromBinaryString(b8And9); + //SystemClockReferenceRemainder = (ulong)(((buffer[8] & Helper.B00000011) << 8) + buffer[9]) ProgramMuxRate = Helper.GetEndian(buffer, 10, 3) >> 2; diff --git a/src/Logic/VobSub/VobSubParser.cs b/src/Logic/VobSub/VobSubParser.cs index 6d697730a..48a850015 100644 --- a/src/Logic/VobSub/VobSubParser.cs +++ b/src/Logic/VobSub/VobSubParser.cs @@ -154,6 +154,7 @@ namespace Nikse.SubtitleEdit.Logic.VobSub { if (ms.Length > 0) list.Add(new VobSubMergedPack(ms.ToArray(), pts, streamId, lastIdxParagraph)); + ms.Close(); ms = new MemoryStream(); pts = TimeSpan.FromMilliseconds(Convert.ToDouble(p.PacketizedElementaryStream.PresentationTimeStamp / ticksPerMillisecond)); //90000F * 1000)); (PAL) streamId = p.PacketizedElementaryStream.SubPictureStreamId.Value; @@ -166,9 +167,11 @@ namespace Nikse.SubtitleEdit.Logic.VobSub if (ms.Length > 0) { list.Add(new VobSubMergedPack(ms.ToArray(), pts, streamId, lastIdxParagraph)); + ms.Close(); ms = new MemoryStream(); } } + ms.Close(); // Remove any bad packs for (int i = list.Count - 1; i >= 0; i--)