From e6b6a86a7786b1b8db0e9018d459cecacade2d34 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 16 Jun 2020 18:46:18 +0100 Subject: [PATCH] Remove support for MKV invisible flag We haven't seen it used anywhere in practice. It's a niche feature not supported by any other extractors, and is one of the very few things stopping us from simplifying MediaSource implementations to not set the decodeOnly sample flag. This is a simplification that we want to make, since the current mechanism doesn't work properly for cases where a downstream decoder adjusts the buffer presentation timestamps so that they're different on the output side than on the input side. PiperOrigin-RevId: 316712302 --- RELEASENOTES.md | 1 + .../android/exoplayer2/extractor/mkv/MatroskaExtractor.java | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 53acfb8193..125ca8ccc9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -176,6 +176,7 @@ timestamps ([#7464](https://github.com/google/ExoPlayer/issues/7464)). * Ogg: Allow non-contiguous pages ([#7230](https://github.com/google/ExoPlayer/issues/7230)). +* Matroska: Remove support for "Invisible" block header flag. * Extractors: * Add `IndexSeeker` for accurate seeks in VBR MP3 streams ([#6787](https://github.com/google/ExoPlayer/issues/6787)). This seeker 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 6d28e870a4..de6d1c19c6 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 @@ -1196,11 +1196,9 @@ public class MatroskaExtractor implements Extractor { int timecode = (scratch.data[0] << 8) | (scratch.data[1] & 0xFF); blockTimeUs = clusterTimecodeUs + scaleTimecodeToUs(timecode); - boolean isInvisible = (scratch.data[2] & 0x08) == 0x08; boolean isKeyframe = track.type == TRACK_TYPE_AUDIO || (id == ID_SIMPLE_BLOCK && (scratch.data[2] & 0x80) == 0x80); - blockFlags = (isKeyframe ? C.BUFFER_FLAG_KEY_FRAME : 0) - | (isInvisible ? C.BUFFER_FLAG_DECODE_ONLY : 0); + blockFlags = isKeyframe ? C.BUFFER_FLAG_KEY_FRAME : 0; blockState = BLOCK_STATE_DATA; blockSampleIndex = 0; }