mirror of
https://github.com/androidx/media.git
synced 2025-05-05 14:40:50 +08:00
Don't print warning when skipping RIFF and FMT chunks
They're not unexpected! PiperOrigin-RevId: 260907687
This commit is contained in:
parent
7ec7aab320
commit
c373ff0a1c
@ -22,7 +22,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/** Reads a {@code WavHeader} from an input stream; supports resuming from input failures. */
|
/** Reads a {@code WavHeader} from an input stream; supports resuming from input failures. */
|
||||||
@ -122,11 +121,13 @@ import java.io.IOException;
|
|||||||
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);
|
||||||
while (chunkHeader.id != Util.getIntegerCodeForString("data")) {
|
while (chunkHeader.id != WavUtil.DATA_FOURCC) {
|
||||||
|
if (chunkHeader.id != WavUtil.RIFF_FOURCC && chunkHeader.id != WavUtil.FMT_FOURCC) {
|
||||||
Log.w(TAG, "Ignoring unknown WAV chunk: " + chunkHeader.id);
|
Log.w(TAG, "Ignoring unknown WAV chunk: " + chunkHeader.id);
|
||||||
|
}
|
||||||
long bytesToSkip = ChunkHeader.SIZE_IN_BYTES + chunkHeader.size;
|
long bytesToSkip = ChunkHeader.SIZE_IN_BYTES + chunkHeader.size;
|
||||||
// Override size of RIFF chunk, since it describes its size as the entire file.
|
// Override size of RIFF chunk, since it describes its size as the entire file.
|
||||||
if (chunkHeader.id == Util.getIntegerCodeForString("RIFF")) {
|
if (chunkHeader.id == WavUtil.RIFF_FOURCC) {
|
||||||
bytesToSkip = ChunkHeader.SIZE_IN_BYTES + 4;
|
bytesToSkip = ChunkHeader.SIZE_IN_BYTES + 4;
|
||||||
}
|
}
|
||||||
if (bytesToSkip > Integer.MAX_VALUE) {
|
if (bytesToSkip > Integer.MAX_VALUE) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user