From e29cb37403b7f100050fc0d155298171be884c9d Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 12 May 2016 08:03:28 -0700 Subject: [PATCH] Fix WavExtractor bug. When skipToData is called the peek position is not equal to the read position of the input. Hence peeking a chunk header and then skipping by that amount wont do the right thing :)! ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122157603 --- .../android/exoplayer/extractor/wav/WavHeaderReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/src/main/java/com/google/android/exoplayer/extractor/wav/WavHeaderReader.java b/library/src/main/java/com/google/android/exoplayer/extractor/wav/WavHeaderReader.java index b61dcfffd2..9df9c7e9ca 100644 --- a/library/src/main/java/com/google/android/exoplayer/extractor/wav/WavHeaderReader.java +++ b/library/src/main/java/com/google/android/exoplayer/extractor/wav/WavHeaderReader.java @@ -125,6 +125,9 @@ import java.io.IOException; Assertions.checkNotNull(input); Assertions.checkNotNull(wavHeader); + // Make sure the peek position is set to the read position before we peek the first header. + input.resetPeekPosition(); + ParsableByteArray scratch = new ParsableByteArray(ChunkHeader.SIZE_IN_BYTES); // Skip all chunks until we hit the data header. ChunkHeader chunkHeader = ChunkHeader.peek(input, scratch);