Add release note and update comment

This commit is contained in:
Rohit Singh 2024-02-27 15:59:59 +00:00
parent b254c4625d
commit 1994ba991c
2 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,8 @@
* Add support for composition-level audio effects.
* Track Selection:
* Extractors:
* Fix issue where padding was not skipped when reading odd-sized chunks
from WAV files ([#1117](https://github.com/androidx/media/pull/1117)).
* Audio:
* Allow renderer recovery by disabling offload if audio track fails to
initialize in offload mode.

View File

@ -172,8 +172,9 @@ import java.io.IOException;
while (chunkHeader.id != chunkId) {
Log.w(TAG, "Ignoring unknown WAV chunk: " + chunkHeader.id);
long bytesToSkip = ChunkHeader.SIZE_IN_BYTES + chunkHeader.size;
// To align RIFF chunks to certain boundaries the RIFF specification includes a JUNK chunk.
// Its contents are to be skipped when reading.
// According to the RIFF specification, if a chunk's body size is odd, it's followed by a
// padding byte of value 0. This ensures each chunk occupies an even number of bytes in the
// file. The padding byte isn't included in the size field.
if (chunkHeader.size % 2 != 0) {
bytesToSkip++; // padding present if size is odd, skip it.
}