diff --git a/src/Test/Files/sample_MKV_VobSub_PGS.mkv b/src/Test/Files/sample_MKV_VobSub_PGS.mkv new file mode 100644 index 000000000..00f688a58 Binary files /dev/null and b/src/Test/Files/sample_MKV_VobSub_PGS.mkv differ diff --git a/src/Test/Logic/VideoFormats/MatroskaTest.cs b/src/Test/Logic/VideoFormats/MatroskaTest.cs index 910ca9348..ba3eff42f 100644 --- a/src/Test/Logic/VideoFormats/MatroskaTest.cs +++ b/src/Test/Logic/VideoFormats/MatroskaTest.cs @@ -56,5 +56,37 @@ namespace Test.Logic.VideoFormats parser.Dispose(); } + [TestMethod] + public void MatroskaTestVobSubPgs() + { + string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv"); + var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName); + + bool isValid; + var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); + Assert.IsTrue(tracks[0].CodecId == "S_VOBSUB"); + Assert.IsTrue(tracks[1].CodecId == "S_HDMV/PGS"); + parser.Dispose(); + } + + [TestMethod] + public void MatroskaTestVobSubPgsContent() + { + string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv"); + var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName); + + bool isValid; + var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); + var subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[0].TrackNumber), out isValid, null); + Assert.IsTrue(subtitles.Count == 2); + //TODO: check bitmaps + + //subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[1].TrackNumber), out isValid, null); + //Assert.IsTrue(subtitles.Count == 2); + //check bitmaps + + parser.Dispose(); + } + } } diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 61e95bd1f..bc4f76f2c 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -78,6 +78,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest