diff --git a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java index 4408ffab83..9c41d361ad 100644 --- a/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java +++ b/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/mp4/Mp4ExtractorTest.java @@ -102,4 +102,10 @@ public final class Mp4ExtractorTest { ExtractorAsserts.assertBehavior( Mp4Extractor::new, "media/mp4/sample_with_color_info.mp4", simulationConfig); } + + @Test + public void mp4SampleWithDolbyTrueHDTrack() throws Exception { + ExtractorAsserts.assertBehavior( + Mp4Extractor::new, "media/mp4/sample_dthd.mp4", simulationConfig); + } } diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.0.dump b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.0.dump new file mode 100644 index 0000000000..d05b05b2cc --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.0.dump @@ -0,0 +1,147 @@ +seekMap: + isSeekable = true + duration = 418333 + getPosition(0) = [[timeUs=0, position=3447]] + getPosition(1) = [[timeUs=1, position=3447]] + getPosition(209166) = [[timeUs=209166, position=27035]] + getPosition(418333) = [[timeUs=418333, position=75365]] +numberOfTracks = 1 +track 0: + total output bytes = 94656 + sample count = 32 + format 0: + id = 1 + sampleMimeType = audio/true-hd + maxInputSize = 12480 + channelCount = 2 + sampleRate = 48000 + language = und + sample 0: + time = 0 + flags = 1 + data = length 3512, hash B77F1117 + sample 1: + time = 13333 + flags = 0 + data = length 2830, hash 4B19B7D5 + sample 2: + time = 26666 + flags = 0 + data = length 2868, hash BC04A38E + sample 3: + time = 40000 + flags = 0 + data = length 2834, hash D2AF8AF9 + sample 4: + time = 53333 + flags = 0 + data = length 2898, hash 5C9B3119 + sample 5: + time = 66666 + flags = 0 + data = length 2800, hash 31B9C93F + sample 6: + time = 80000 + flags = 0 + data = length 2866, hash 7FCABDBC + sample 7: + time = 93333 + flags = 0 + data = length 2980, hash FC2CCBDA + sample 8: + time = 106666 + flags = 1 + data = length 3432, hash 17F43166 + sample 9: + time = 120000 + flags = 0 + data = length 2974, hash 69EDFD38 + sample 10: + time = 133333 + flags = 0 + data = length 2898, hash 60E09542 + sample 11: + time = 146666 + flags = 0 + data = length 2896, hash 94A43D4A + sample 12: + time = 160000 + flags = 0 + data = length 3008, hash 82D706BB + sample 13: + time = 173333 + flags = 0 + data = length 2918, hash 22DE72A8 + sample 14: + time = 186666 + flags = 0 + data = length 2990, hash E478A008 + sample 15: + time = 200000 + flags = 0 + data = length 2860, hash B5C3DE40 + sample 16: + time = 213333 + flags = 1 + data = length 3638, hash 3FCD885B + sample 17: + time = 226666 + flags = 0 + data = length 2968, hash A3692382 + sample 18: + time = 240000 + flags = 0 + data = length 2940, hash 72A71C81 + sample 19: + time = 253333 + flags = 0 + data = length 3010, hash A826B2C3 + sample 20: + time = 266666 + flags = 0 + data = length 2952, hash BCEA8C02 + sample 21: + time = 280000 + flags = 0 + data = length 3018, hash C313A53F + sample 22: + time = 293333 + flags = 0 + data = length 2930, hash 4AAB358 + sample 23: + time = 306666 + flags = 0 + data = length 2898, hash C2C22662 + sample 24: + time = 320000 + flags = 1 + data = length 3680, hash 354DF989 + sample 25: + time = 333333 + flags = 0 + data = length 2970, hash 3191F764 + sample 26: + time = 346666 + flags = 0 + data = length 3044, hash 9E115802 + sample 27: + time = 360000 + flags = 0 + data = length 2946, hash B1341399 + sample 28: + time = 373333 + flags = 0 + data = length 2992, hash 4DA27845 + sample 29: + time = 386666 + flags = 0 + data = length 2930, hash 140DC44C + sample 30: + time = 400000 + flags = 0 + data = length 2960, hash 5287EBF8 + sample 31: + time = 413333 + flags = 0 + data = length 1216, hash B83FE151 +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.1.dump b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.1.dump new file mode 100644 index 0000000000..47ac8e4b97 --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.1.dump @@ -0,0 +1,115 @@ +seekMap: + isSeekable = true + duration = 418333 + getPosition(0) = [[timeUs=0, position=3447]] + getPosition(1) = [[timeUs=1, position=3447]] + getPosition(209166) = [[timeUs=209166, position=27035]] + getPosition(418333) = [[timeUs=418333, position=75365]] +numberOfTracks = 1 +track 0: + total output bytes = 71068 + sample count = 24 + format 0: + id = 1 + sampleMimeType = audio/true-hd + maxInputSize = 12480 + channelCount = 2 + sampleRate = 48000 + language = und + sample 0: + time = 106666 + flags = 1 + data = length 3432, hash 17F43166 + sample 1: + time = 120000 + flags = 0 + data = length 2974, hash 69EDFD38 + sample 2: + time = 133333 + flags = 0 + data = length 2898, hash 60E09542 + sample 3: + time = 146666 + flags = 0 + data = length 2896, hash 94A43D4A + sample 4: + time = 160000 + flags = 0 + data = length 3008, hash 82D706BB + sample 5: + time = 173333 + flags = 0 + data = length 2918, hash 22DE72A8 + sample 6: + time = 186666 + flags = 0 + data = length 2990, hash E478A008 + sample 7: + time = 200000 + flags = 0 + data = length 2860, hash B5C3DE40 + sample 8: + time = 213333 + flags = 1 + data = length 3638, hash 3FCD885B + sample 9: + time = 226666 + flags = 0 + data = length 2968, hash A3692382 + sample 10: + time = 240000 + flags = 0 + data = length 2940, hash 72A71C81 + sample 11: + time = 253333 + flags = 0 + data = length 3010, hash A826B2C3 + sample 12: + time = 266666 + flags = 0 + data = length 2952, hash BCEA8C02 + sample 13: + time = 280000 + flags = 0 + data = length 3018, hash C313A53F + sample 14: + time = 293333 + flags = 0 + data = length 2930, hash 4AAB358 + sample 15: + time = 306666 + flags = 0 + data = length 2898, hash C2C22662 + sample 16: + time = 320000 + flags = 1 + data = length 3680, hash 354DF989 + sample 17: + time = 333333 + flags = 0 + data = length 2970, hash 3191F764 + sample 18: + time = 346666 + flags = 0 + data = length 3044, hash 9E115802 + sample 19: + time = 360000 + flags = 0 + data = length 2946, hash B1341399 + sample 20: + time = 373333 + flags = 0 + data = length 2992, hash 4DA27845 + sample 21: + time = 386666 + flags = 0 + data = length 2930, hash 140DC44C + sample 22: + time = 400000 + flags = 0 + data = length 2960, hash 5287EBF8 + sample 23: + time = 413333 + flags = 0 + data = length 1216, hash B83FE151 +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.2.dump b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.2.dump new file mode 100644 index 0000000000..c52bcbffed --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.2.dump @@ -0,0 +1,83 @@ +seekMap: + isSeekable = true + duration = 418333 + getPosition(0) = [[timeUs=0, position=3447]] + getPosition(1) = [[timeUs=1, position=3447]] + getPosition(209166) = [[timeUs=209166, position=27035]] + getPosition(418333) = [[timeUs=418333, position=75365]] +numberOfTracks = 1 +track 0: + total output bytes = 47092 + sample count = 16 + format 0: + id = 1 + sampleMimeType = audio/true-hd + maxInputSize = 12480 + channelCount = 2 + sampleRate = 48000 + language = und + sample 0: + time = 213333 + flags = 1 + data = length 3638, hash 3FCD885B + sample 1: + time = 226666 + flags = 0 + data = length 2968, hash A3692382 + sample 2: + time = 240000 + flags = 0 + data = length 2940, hash 72A71C81 + sample 3: + time = 253333 + flags = 0 + data = length 3010, hash A826B2C3 + sample 4: + time = 266666 + flags = 0 + data = length 2952, hash BCEA8C02 + sample 5: + time = 280000 + flags = 0 + data = length 3018, hash C313A53F + sample 6: + time = 293333 + flags = 0 + data = length 2930, hash 4AAB358 + sample 7: + time = 306666 + flags = 0 + data = length 2898, hash C2C22662 + sample 8: + time = 320000 + flags = 1 + data = length 3680, hash 354DF989 + sample 9: + time = 333333 + flags = 0 + data = length 2970, hash 3191F764 + sample 10: + time = 346666 + flags = 0 + data = length 3044, hash 9E115802 + sample 11: + time = 360000 + flags = 0 + data = length 2946, hash B1341399 + sample 12: + time = 373333 + flags = 0 + data = length 2992, hash 4DA27845 + sample 13: + time = 386666 + flags = 0 + data = length 2930, hash 140DC44C + sample 14: + time = 400000 + flags = 0 + data = length 2960, hash 5287EBF8 + sample 15: + time = 413333 + flags = 0 + data = length 1216, hash B83FE151 +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.3.dump b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.3.dump new file mode 100644 index 0000000000..1d226c257a --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.3.dump @@ -0,0 +1,51 @@ +seekMap: + isSeekable = true + duration = 418333 + getPosition(0) = [[timeUs=0, position=3447]] + getPosition(1) = [[timeUs=1, position=3447]] + getPosition(209166) = [[timeUs=209166, position=27035]] + getPosition(418333) = [[timeUs=418333, position=75365]] +numberOfTracks = 1 +track 0: + total output bytes = 22738 + sample count = 8 + format 0: + id = 1 + sampleMimeType = audio/true-hd + maxInputSize = 12480 + channelCount = 2 + sampleRate = 48000 + language = und + sample 0: + time = 320000 + flags = 1 + data = length 3680, hash 354DF989 + sample 1: + time = 333333 + flags = 0 + data = length 2970, hash 3191F764 + sample 2: + time = 346666 + flags = 0 + data = length 3044, hash 9E115802 + sample 3: + time = 360000 + flags = 0 + data = length 2946, hash B1341399 + sample 4: + time = 373333 + flags = 0 + data = length 2992, hash 4DA27845 + sample 5: + time = 386666 + flags = 0 + data = length 2930, hash 140DC44C + sample 6: + time = 400000 + flags = 0 + data = length 2960, hash 5287EBF8 + sample 7: + time = 413333 + flags = 0 + data = length 1216, hash B83FE151 +tracksEnded = true diff --git a/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.unknown_length.dump b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.unknown_length.dump new file mode 100644 index 0000000000..d05b05b2cc --- /dev/null +++ b/testdata/src/test/assets/extractordumps/mp4/sample_dthd.mp4.unknown_length.dump @@ -0,0 +1,147 @@ +seekMap: + isSeekable = true + duration = 418333 + getPosition(0) = [[timeUs=0, position=3447]] + getPosition(1) = [[timeUs=1, position=3447]] + getPosition(209166) = [[timeUs=209166, position=27035]] + getPosition(418333) = [[timeUs=418333, position=75365]] +numberOfTracks = 1 +track 0: + total output bytes = 94656 + sample count = 32 + format 0: + id = 1 + sampleMimeType = audio/true-hd + maxInputSize = 12480 + channelCount = 2 + sampleRate = 48000 + language = und + sample 0: + time = 0 + flags = 1 + data = length 3512, hash B77F1117 + sample 1: + time = 13333 + flags = 0 + data = length 2830, hash 4B19B7D5 + sample 2: + time = 26666 + flags = 0 + data = length 2868, hash BC04A38E + sample 3: + time = 40000 + flags = 0 + data = length 2834, hash D2AF8AF9 + sample 4: + time = 53333 + flags = 0 + data = length 2898, hash 5C9B3119 + sample 5: + time = 66666 + flags = 0 + data = length 2800, hash 31B9C93F + sample 6: + time = 80000 + flags = 0 + data = length 2866, hash 7FCABDBC + sample 7: + time = 93333 + flags = 0 + data = length 2980, hash FC2CCBDA + sample 8: + time = 106666 + flags = 1 + data = length 3432, hash 17F43166 + sample 9: + time = 120000 + flags = 0 + data = length 2974, hash 69EDFD38 + sample 10: + time = 133333 + flags = 0 + data = length 2898, hash 60E09542 + sample 11: + time = 146666 + flags = 0 + data = length 2896, hash 94A43D4A + sample 12: + time = 160000 + flags = 0 + data = length 3008, hash 82D706BB + sample 13: + time = 173333 + flags = 0 + data = length 2918, hash 22DE72A8 + sample 14: + time = 186666 + flags = 0 + data = length 2990, hash E478A008 + sample 15: + time = 200000 + flags = 0 + data = length 2860, hash B5C3DE40 + sample 16: + time = 213333 + flags = 1 + data = length 3638, hash 3FCD885B + sample 17: + time = 226666 + flags = 0 + data = length 2968, hash A3692382 + sample 18: + time = 240000 + flags = 0 + data = length 2940, hash 72A71C81 + sample 19: + time = 253333 + flags = 0 + data = length 3010, hash A826B2C3 + sample 20: + time = 266666 + flags = 0 + data = length 2952, hash BCEA8C02 + sample 21: + time = 280000 + flags = 0 + data = length 3018, hash C313A53F + sample 22: + time = 293333 + flags = 0 + data = length 2930, hash 4AAB358 + sample 23: + time = 306666 + flags = 0 + data = length 2898, hash C2C22662 + sample 24: + time = 320000 + flags = 1 + data = length 3680, hash 354DF989 + sample 25: + time = 333333 + flags = 0 + data = length 2970, hash 3191F764 + sample 26: + time = 346666 + flags = 0 + data = length 3044, hash 9E115802 + sample 27: + time = 360000 + flags = 0 + data = length 2946, hash B1341399 + sample 28: + time = 373333 + flags = 0 + data = length 2992, hash 4DA27845 + sample 29: + time = 386666 + flags = 0 + data = length 2930, hash 140DC44C + sample 30: + time = 400000 + flags = 0 + data = length 2960, hash 5287EBF8 + sample 31: + time = 413333 + flags = 0 + data = length 1216, hash B83FE151 +tracksEnded = true diff --git a/testdata/src/test/assets/media/mp4/sample_dthd.mp4 b/testdata/src/test/assets/media/mp4/sample_dthd.mp4 new file mode 100644 index 0000000000..c5d3eb2a39 Binary files /dev/null and b/testdata/src/test/assets/media/mp4/sample_dthd.mp4 differ