diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 976942f86f..fc655e4e9f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -5,6 +5,9 @@ * IMA extension: * Fix a condition where playback can get stuck before an empty ad ([#8205](https://github.com/google/ExoPlayer/issues/8205)). +* Text: + * Gracefully handle null-terminated subtitle content in Matroska + containers. ### 2.12.2 (2020-12-01) ### diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java index c8f4cadcb1..f4022fe780 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java @@ -1307,6 +1307,15 @@ public class MatroskaExtractor implements Extractor { Log.w(TAG, "Skipping subtitle sample with no duration."); } else { setSubtitleEndTime(track.codecId, blockDurationUs, subtitleSample.getData()); + // The Matroska spec doesn't clearly define whether subtitle samples are null-terminated + // or the sample should instead be sized precisely. We truncate the sample at a null-byte + // to gracefully handle null-terminated strings followed by garbage bytes. + for (int i = subtitleSample.getPosition(); i < subtitleSample.limit(); i++) { + if (subtitleSample.getData()[i] == 0) { + subtitleSample.setLimit(i); + break; + } + } // Note: If we ever want to support DRM protected subtitles then we'll need to output the // appropriate encryption data here. track.output.sampleData(subtitleSample, subtitleSample.limit()); diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractorTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractorTest.java index 9c0e2761d3..45c0bd1c9f 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractorTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractorTest.java @@ -46,12 +46,27 @@ public final class MatroskaExtractorTest { MatroskaExtractor::new, "media/mkv/sample_with_srt.mkv", simulationConfig); } + @Test + public void mkvSample_withNullTerminatedSubripSubtitles() throws Exception { + ExtractorAsserts.assertBehavior( + MatroskaExtractor::new, "media/mkv/sample_with_null_terminated_srt.mkv", simulationConfig); + } + @Test public void mkvSample_withSsaSubtitles() throws Exception { ExtractorAsserts.assertBehavior( MatroskaExtractor::new, "media/mkv/sample_with_ssa_subtitles.mkv", simulationConfig); } + // https://github.com/google/ExoPlayer/pull/8265 + @Test + public void mkvSample_withNullTerminatedSsaSubtitles() throws Exception { + ExtractorAsserts.assertBehavior( + MatroskaExtractor::new, + "media/mkv/sample_with_null_terminated_ssa_subtitles.mkv", + simulationConfig); + } + @Test public void mkvSample_withHtcRotationInfoInTrackName() throws Exception { ExtractorAsserts.assertBehavior( diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.0.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.0.dump new file mode 100644 index 0000000000..ccf35b8c27 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.0.dump @@ -0,0 +1,281 @@ +seekMap: + isSeekable = true + duration = 1234000 + getPosition(0) = [[timeUs=0, position=1163]] + getPosition(1) = [[timeUs=0, position=1163]] + getPosition(617000) = [[timeUs=0, position=1163]] + getPosition(1234000) = [[timeUs=0, position=1163]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 67000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 33000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 200000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 133000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 100000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 167000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 333000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 267000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 233000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 300000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 433000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 400000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 367000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 567000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 500000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 467000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 533000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 700000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 633000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 600000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 667000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 833000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 767000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 733000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 800000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 967000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 900000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 867000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 933000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 62000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 97000 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 131000 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 166000 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 201000 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 236000 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 270000 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 306000 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 341000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 376000 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 410000 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 445000 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 480000 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 514000 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 550000 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 585000 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 620000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 654000 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 690000 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 724000 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 759000 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 793000 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 829000 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 864000 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 898000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 932000 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 968000 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1002000 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1037000 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 49 + sample count = 1 + format 0: + id = 3 + sampleMimeType = application/x-subrip + selectionFlags = 1 + language = en + label = Subs Label + sample 0: + time = 0 + flags = 1 + data = length 49, hash DE7F89EF +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.1.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.1.dump new file mode 100644 index 0000000000..ccf35b8c27 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.1.dump @@ -0,0 +1,281 @@ +seekMap: + isSeekable = true + duration = 1234000 + getPosition(0) = [[timeUs=0, position=1163]] + getPosition(1) = [[timeUs=0, position=1163]] + getPosition(617000) = [[timeUs=0, position=1163]] + getPosition(1234000) = [[timeUs=0, position=1163]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 67000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 33000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 200000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 133000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 100000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 167000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 333000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 267000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 233000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 300000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 433000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 400000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 367000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 567000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 500000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 467000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 533000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 700000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 633000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 600000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 667000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 833000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 767000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 733000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 800000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 967000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 900000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 867000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 933000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 62000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 97000 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 131000 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 166000 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 201000 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 236000 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 270000 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 306000 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 341000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 376000 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 410000 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 445000 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 480000 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 514000 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 550000 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 585000 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 620000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 654000 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 690000 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 724000 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 759000 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 793000 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 829000 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 864000 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 898000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 932000 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 968000 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1002000 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1037000 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 49 + sample count = 1 + format 0: + id = 3 + sampleMimeType = application/x-subrip + selectionFlags = 1 + language = en + label = Subs Label + sample 0: + time = 0 + flags = 1 + data = length 49, hash DE7F89EF +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.2.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.2.dump new file mode 100644 index 0000000000..ccf35b8c27 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.2.dump @@ -0,0 +1,281 @@ +seekMap: + isSeekable = true + duration = 1234000 + getPosition(0) = [[timeUs=0, position=1163]] + getPosition(1) = [[timeUs=0, position=1163]] + getPosition(617000) = [[timeUs=0, position=1163]] + getPosition(1234000) = [[timeUs=0, position=1163]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 67000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 33000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 200000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 133000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 100000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 167000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 333000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 267000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 233000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 300000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 433000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 400000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 367000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 567000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 500000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 467000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 533000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 700000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 633000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 600000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 667000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 833000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 767000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 733000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 800000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 967000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 900000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 867000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 933000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 62000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 97000 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 131000 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 166000 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 201000 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 236000 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 270000 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 306000 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 341000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 376000 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 410000 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 445000 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 480000 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 514000 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 550000 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 585000 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 620000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 654000 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 690000 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 724000 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 759000 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 793000 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 829000 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 864000 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 898000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 932000 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 968000 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1002000 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1037000 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 49 + sample count = 1 + format 0: + id = 3 + sampleMimeType = application/x-subrip + selectionFlags = 1 + language = en + label = Subs Label + sample 0: + time = 0 + flags = 1 + data = length 49, hash DE7F89EF +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.3.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.3.dump new file mode 100644 index 0000000000..ccf35b8c27 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.3.dump @@ -0,0 +1,281 @@ +seekMap: + isSeekable = true + duration = 1234000 + getPosition(0) = [[timeUs=0, position=1163]] + getPosition(1) = [[timeUs=0, position=1163]] + getPosition(617000) = [[timeUs=0, position=1163]] + getPosition(1234000) = [[timeUs=0, position=1163]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 67000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 33000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 200000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 133000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 100000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 167000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 333000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 267000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 233000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 300000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 433000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 400000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 367000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 567000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 500000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 467000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 533000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 700000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 633000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 600000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 667000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 833000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 767000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 733000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 800000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 967000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 900000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 867000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 933000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 62000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 97000 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 131000 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 166000 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 201000 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 236000 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 270000 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 306000 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 341000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 376000 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 410000 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 445000 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 480000 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 514000 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 550000 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 585000 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 620000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 654000 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 690000 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 724000 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 759000 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 793000 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 829000 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 864000 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 898000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 932000 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 968000 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1002000 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1037000 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 49 + sample count = 1 + format 0: + id = 3 + sampleMimeType = application/x-subrip + selectionFlags = 1 + language = en + label = Subs Label + sample 0: + time = 0 + flags = 1 + data = length 49, hash DE7F89EF +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.unknown_length.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.unknown_length.dump new file mode 100644 index 0000000000..ccf35b8c27 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_srt.mkv.unknown_length.dump @@ -0,0 +1,281 @@ +seekMap: + isSeekable = true + duration = 1234000 + getPosition(0) = [[timeUs=0, position=1163]] + getPosition(1) = [[timeUs=0, position=1163]] + getPosition(617000) = [[timeUs=0, position=1163]] + getPosition(1234000) = [[timeUs=0, position=1163]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 67000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 33000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 200000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 133000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 100000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 167000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 333000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 267000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 233000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 300000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 433000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 400000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 367000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 567000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 500000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 467000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 533000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 700000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 633000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 600000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 667000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 833000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 767000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 733000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 800000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 967000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 900000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 867000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 933000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 62000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 97000 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 131000 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 166000 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 201000 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 236000 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 270000 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 306000 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 341000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 376000 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 410000 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 445000 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 480000 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 514000 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 550000 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 585000 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 620000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 654000 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 690000 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 724000 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 759000 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 793000 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 829000 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 864000 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 898000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 932000 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 968000 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1002000 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1037000 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 49 + sample count = 1 + format 0: + id = 3 + sampleMimeType = application/x-subrip + selectionFlags = 1 + language = en + label = Subs Label + sample 0: + time = 0 + flags = 1 + data = length 49, hash DE7F89EF +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.0.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.0.dump new file mode 100644 index 0000000000..ec1eaf729b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.0.dump @@ -0,0 +1,283 @@ +seekMap: + isSeekable = true + duration = 1139000 + getPosition(0) = [[timeUs=0, position=6106]] + getPosition(1) = [[timeUs=0, position=6106], [timeUs=67000, position=6106]] + getPosition(569500) = [[timeUs=67000, position=6106]] + getPosition(1139000) = [[timeUs=67000, position=6106]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 67000 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 134000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 100000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 267000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 200000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 167000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 234000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 400000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 334000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 300000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 367000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 500000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 467000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 434000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 634000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 567000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 534000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 600000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 767000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 700000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 667000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 734000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 900000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 834000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 800000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 867000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 1034000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 967000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 934000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 1000000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 129000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 163829 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 198659 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 233489 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 268319 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 303149 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 337979 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 372809 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 408000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 442829 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 477659 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 512489 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 547319 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 582149 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 616979 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 651809 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 687000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 721829 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 756659 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 791489 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 826319 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 861149 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 895979 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 930809 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 965000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 999829 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 1034659 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1069489 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1104319 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 71 + sample count = 1 + format 0: + id = 3 + sampleMimeType = text/x-ssa + selectionFlags = 1 + language = und + initializationData: + data = length 90, hash A5E21974 + data = length 470, hash 40E7D996 + sample 0: + time = 0 + flags = 1 + data = length 71, hash 2B8E631C +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.1.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.1.dump new file mode 100644 index 0000000000..ec1eaf729b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.1.dump @@ -0,0 +1,283 @@ +seekMap: + isSeekable = true + duration = 1139000 + getPosition(0) = [[timeUs=0, position=6106]] + getPosition(1) = [[timeUs=0, position=6106], [timeUs=67000, position=6106]] + getPosition(569500) = [[timeUs=67000, position=6106]] + getPosition(1139000) = [[timeUs=67000, position=6106]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 67000 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 134000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 100000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 267000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 200000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 167000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 234000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 400000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 334000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 300000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 367000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 500000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 467000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 434000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 634000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 567000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 534000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 600000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 767000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 700000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 667000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 734000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 900000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 834000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 800000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 867000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 1034000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 967000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 934000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 1000000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 129000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 163829 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 198659 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 233489 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 268319 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 303149 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 337979 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 372809 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 408000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 442829 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 477659 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 512489 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 547319 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 582149 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 616979 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 651809 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 687000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 721829 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 756659 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 791489 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 826319 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 861149 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 895979 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 930809 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 965000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 999829 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 1034659 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1069489 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1104319 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 71 + sample count = 1 + format 0: + id = 3 + sampleMimeType = text/x-ssa + selectionFlags = 1 + language = und + initializationData: + data = length 90, hash A5E21974 + data = length 470, hash 40E7D996 + sample 0: + time = 0 + flags = 1 + data = length 71, hash 2B8E631C +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.2.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.2.dump new file mode 100644 index 0000000000..ec1eaf729b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.2.dump @@ -0,0 +1,283 @@ +seekMap: + isSeekable = true + duration = 1139000 + getPosition(0) = [[timeUs=0, position=6106]] + getPosition(1) = [[timeUs=0, position=6106], [timeUs=67000, position=6106]] + getPosition(569500) = [[timeUs=67000, position=6106]] + getPosition(1139000) = [[timeUs=67000, position=6106]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 67000 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 134000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 100000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 267000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 200000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 167000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 234000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 400000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 334000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 300000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 367000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 500000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 467000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 434000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 634000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 567000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 534000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 600000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 767000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 700000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 667000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 734000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 900000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 834000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 800000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 867000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 1034000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 967000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 934000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 1000000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 129000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 163829 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 198659 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 233489 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 268319 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 303149 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 337979 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 372809 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 408000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 442829 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 477659 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 512489 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 547319 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 582149 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 616979 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 651809 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 687000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 721829 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 756659 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 791489 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 826319 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 861149 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 895979 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 930809 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 965000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 999829 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 1034659 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1069489 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1104319 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 71 + sample count = 1 + format 0: + id = 3 + sampleMimeType = text/x-ssa + selectionFlags = 1 + language = und + initializationData: + data = length 90, hash A5E21974 + data = length 470, hash 40E7D996 + sample 0: + time = 0 + flags = 1 + data = length 71, hash 2B8E631C +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.3.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.3.dump new file mode 100644 index 0000000000..ec1eaf729b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.3.dump @@ -0,0 +1,283 @@ +seekMap: + isSeekable = true + duration = 1139000 + getPosition(0) = [[timeUs=0, position=6106]] + getPosition(1) = [[timeUs=0, position=6106], [timeUs=67000, position=6106]] + getPosition(569500) = [[timeUs=67000, position=6106]] + getPosition(1139000) = [[timeUs=67000, position=6106]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 67000 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 134000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 100000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 267000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 200000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 167000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 234000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 400000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 334000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 300000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 367000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 500000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 467000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 434000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 634000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 567000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 534000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 600000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 767000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 700000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 667000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 734000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 900000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 834000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 800000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 867000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 1034000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 967000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 934000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 1000000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 129000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 163829 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 198659 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 233489 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 268319 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 303149 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 337979 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 372809 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 408000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 442829 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 477659 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 512489 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 547319 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 582149 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 616979 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 651809 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 687000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 721829 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 756659 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 791489 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 826319 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 861149 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 895979 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 930809 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 965000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 999829 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 1034659 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1069489 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1104319 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 71 + sample count = 1 + format 0: + id = 3 + sampleMimeType = text/x-ssa + selectionFlags = 1 + language = und + initializationData: + data = length 90, hash A5E21974 + data = length 470, hash 40E7D996 + sample 0: + time = 0 + flags = 1 + data = length 71, hash 2B8E631C +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.unknown_length.dump b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.unknown_length.dump new file mode 100644 index 0000000000..ec1eaf729b --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mkv/sample_with_null_terminated_ssa_subtitles.mkv.unknown_length.dump @@ -0,0 +1,283 @@ +seekMap: + isSeekable = true + duration = 1139000 + getPosition(0) = [[timeUs=0, position=6106]] + getPosition(1) = [[timeUs=0, position=6106], [timeUs=67000, position=6106]] + getPosition(569500) = [[timeUs=67000, position=6106]] + getPosition(1139000) = [[timeUs=67000, position=6106]] +numberOfTracks = 3 +track 1: + total output bytes = 89502 + sample count = 30 + format 0: + id = 1 + sampleMimeType = video/avc + width = 1080 + height = 720 + selectionFlags = 1 + language = und + initializationData: + data = length 30, hash F6F3D010 + data = length 10, hash 7A0D0F2B + sample 0: + time = 67000 + flags = 1 + data = length 36477, hash F0F36CFE + sample 1: + time = 134000 + flags = 0 + data = length 5341, hash 40B85E2 + sample 2: + time = 100000 + flags = 0 + data = length 596, hash 357B4D92 + sample 3: + time = 267000 + flags = 0 + data = length 7704, hash A39EDA06 + sample 4: + time = 200000 + flags = 0 + data = length 989, hash 2813C72D + sample 5: + time = 167000 + flags = 0 + data = length 721, hash C50D1C73 + sample 6: + time = 234000 + flags = 0 + data = length 519, hash 65FE1911 + sample 7: + time = 400000 + flags = 0 + data = length 6160, hash E1CAC0EC + sample 8: + time = 334000 + flags = 0 + data = length 953, hash 7160C661 + sample 9: + time = 300000 + flags = 0 + data = length 620, hash 7A7AE07C + sample 10: + time = 367000 + flags = 0 + data = length 405, hash 5CC7F4E7 + sample 11: + time = 500000 + flags = 0 + data = length 4852, hash 9DB6979D + sample 12: + time = 467000 + flags = 0 + data = length 547, hash E31A6979 + sample 13: + time = 434000 + flags = 0 + data = length 570, hash FEC40D00 + sample 14: + time = 634000 + flags = 0 + data = length 5525, hash 7C478F7E + sample 15: + time = 567000 + flags = 0 + data = length 1082, hash DA07059A + sample 16: + time = 534000 + flags = 0 + data = length 807, hash 93478E6B + sample 17: + time = 600000 + flags = 0 + data = length 744, hash 9A8E6026 + sample 18: + time = 767000 + flags = 0 + data = length 4732, hash C73B23C0 + sample 19: + time = 700000 + flags = 0 + data = length 1004, hash 8A19A228 + sample 20: + time = 667000 + flags = 0 + data = length 794, hash 8126022C + sample 21: + time = 734000 + flags = 0 + data = length 645, hash F08300E5 + sample 22: + time = 900000 + flags = 0 + data = length 2684, hash 727FE378 + sample 23: + time = 834000 + flags = 0 + data = length 787, hash 419A7821 + sample 24: + time = 800000 + flags = 0 + data = length 649, hash 5C159346 + sample 25: + time = 867000 + flags = 0 + data = length 509, hash F912D655 + sample 26: + time = 1034000 + flags = 0 + data = length 1226, hash 29815C21 + sample 27: + time = 967000 + flags = 0 + data = length 898, hash D997AD0A + sample 28: + time = 934000 + flags = 0 + data = length 476, hash A0423645 + sample 29: + time = 1000000 + flags = 0 + data = length 486, hash DDF32CBB +track 2: + total output bytes = 12120 + sample count = 29 + format 0: + id = 2 + sampleMimeType = audio/ac3 + channelCount = 1 + sampleRate = 44100 + selectionFlags = 1 + language = und + sample 0: + time = 129000 + flags = 1 + data = length 416, hash 211F2286 + sample 1: + time = 163829 + flags = 1 + data = length 418, hash 77425A86 + sample 2: + time = 198659 + flags = 1 + data = length 418, hash A0FE5CA1 + sample 3: + time = 233489 + flags = 1 + data = length 418, hash 2309B066 + sample 4: + time = 268319 + flags = 1 + data = length 418, hash 928A653B + sample 5: + time = 303149 + flags = 1 + data = length 418, hash 3422F0CB + sample 6: + time = 337979 + flags = 1 + data = length 418, hash EFF43D5B + sample 7: + time = 372809 + flags = 1 + data = length 418, hash FC8093C7 + sample 8: + time = 408000 + flags = 1 + data = length 418, hash CCC08A16 + sample 9: + time = 442829 + flags = 1 + data = length 418, hash 2A6EE863 + sample 10: + time = 477659 + flags = 1 + data = length 418, hash D69A9251 + sample 11: + time = 512489 + flags = 1 + data = length 418, hash BCFB758D + sample 12: + time = 547319 + flags = 1 + data = length 418, hash 11B66799 + sample 13: + time = 582149 + flags = 1 + data = length 418, hash C824D392 + sample 14: + time = 616979 + flags = 1 + data = length 418, hash C167D872 + sample 15: + time = 651809 + flags = 1 + data = length 418, hash 4221C855 + sample 16: + time = 687000 + flags = 1 + data = length 418, hash 4D4FF934 + sample 17: + time = 721829 + flags = 1 + data = length 418, hash 984AA025 + sample 18: + time = 756659 + flags = 1 + data = length 418, hash BB788B46 + sample 19: + time = 791489 + flags = 1 + data = length 418, hash 9EFBFD97 + sample 20: + time = 826319 + flags = 1 + data = length 418, hash DF1A460C + sample 21: + time = 861149 + flags = 1 + data = length 418, hash 2BDB56A + sample 22: + time = 895979 + flags = 1 + data = length 418, hash CA230060 + sample 23: + time = 930809 + flags = 1 + data = length 418, hash D2F19F41 + sample 24: + time = 965000 + flags = 1 + data = length 418, hash AF392D79 + sample 25: + time = 999829 + flags = 1 + data = length 418, hash C5D7F2A3 + sample 26: + time = 1034659 + flags = 1 + data = length 418, hash 733A35AE + sample 27: + time = 1069489 + flags = 1 + data = length 418, hash DE46E5D3 + sample 28: + time = 1104319 + flags = 1 + data = length 418, hash 56AB8D37 +track 3: + total output bytes = 71 + sample count = 1 + format 0: + id = 3 + sampleMimeType = text/x-ssa + selectionFlags = 1 + language = und + initializationData: + data = length 90, hash A5E21974 + data = length 470, hash 40E7D996 + sample 0: + time = 0 + flags = 1 + data = length 71, hash 2B8E631C +tracksEnded = true diff --git a/testdata/src/test/assets/media/mkv/sample_with_null_terminated_srt.mkv b/testdata/src/test/assets/media/mkv/sample_with_null_terminated_srt.mkv new file mode 100644 index 0000000000..8a9298a7bc Binary files /dev/null and b/testdata/src/test/assets/media/mkv/sample_with_null_terminated_srt.mkv differ diff --git a/testdata/src/test/assets/media/mkv/sample_with_null_terminated_ssa_subtitles.mkv b/testdata/src/test/assets/media/mkv/sample_with_null_terminated_ssa_subtitles.mkv new file mode 100644 index 0000000000..8a125b2d50 Binary files /dev/null and b/testdata/src/test/assets/media/mkv/sample_with_null_terminated_ssa_subtitles.mkv differ