mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
9bfe62a5a5
commit
e29cb37403
1 changed files with 3 additions and 0 deletions
|
|
@ -125,6 +125,9 @@ import java.io.IOException;
|
||||||
Assertions.checkNotNull(input);
|
Assertions.checkNotNull(input);
|
||||||
Assertions.checkNotNull(wavHeader);
|
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);
|
ParsableByteArray scratch = new ParsableByteArray(ChunkHeader.SIZE_IN_BYTES);
|
||||||
// Skip all chunks until we hit the data header.
|
// Skip all chunks until we hit the data header.
|
||||||
ChunkHeader chunkHeader = ChunkHeader.peek(input, scratch);
|
ChunkHeader chunkHeader = ChunkHeader.peek(input, scratch);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue