From 7abc34c6ae29e1a3f349563a2a00bd30ea3e5fa4 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 19 Jan 2017 13:14:03 -0800 Subject: [PATCH] Respect decode-only flag in MetadataRenderer Issue #2176 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144999973 --- .../google/android/exoplayer2/metadata/MetadataRenderer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java b/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java index 4869611aeb5..550a13771f3 100644 --- a/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java @@ -113,6 +113,10 @@ public void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackEx if (result == C.RESULT_BUFFER_READ) { if (buffer.isEndOfStream()) { inputStreamEnded = true; + } else if (buffer.isDecodeOnly()) { + // Do nothing. Note this assumes that all metadata buffers can be decoded independently. + // If we ever need to support a metadata format where this is not the case, we'll need to + // pass the buffer to the decoder and discard the output. } else { pendingMetadataTimestamp = buffer.timeUs; buffer.subsampleOffsetUs = formatHolder.format.subsampleOffsetUs;