Respect decode-only flag in MetadataRenderer

Issue #2176

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144999973
This commit is contained in:
olly 2017-01-19 13:14:03 -08:00 committed by Oliver Woodman
parent 9617986538
commit 7abc34c6ae

View File

@ -113,6 +113,10 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
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;