Compute format maxInputSize in FlacReader
Use the maximum frame size as the maximum sample size if provided. PiperOrigin-RevId: 279722820
This commit is contained in:
parent
2b1c2171e7
commit
a8b65ca8d6
@ -73,6 +73,8 @@ import java.util.List;
|
||||
byte[] data = packet.data;
|
||||
if (streamMetadata == null) {
|
||||
streamMetadata = new FlacStreamMetadata(data, 17);
|
||||
int maxInputSize =
|
||||
streamMetadata.maxFrameSize == 0 ? Format.NO_VALUE : streamMetadata.maxFrameSize;
|
||||
byte[] metadata = Arrays.copyOfRange(data, 9, packet.limit());
|
||||
metadata[4] = (byte) 0x80; // Set the last metadata block flag, ignore the other blocks
|
||||
List<byte[]> initializationData = Collections.singletonList(metadata);
|
||||
@ -82,7 +84,7 @@ import java.util.List;
|
||||
MimeTypes.AUDIO_FLAC,
|
||||
/* codecs= */ null,
|
||||
streamMetadata.bitRate(),
|
||||
/* maxInputSize= */ Format.NO_VALUE,
|
||||
maxInputSize,
|
||||
streamMetadata.channels,
|
||||
streamMetadata.sampleRate,
|
||||
initializationData,
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -9,7 +9,7 @@ track 0:
|
||||
id = null
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/flac
|
||||
maxInputSize = -1
|
||||
maxInputSize = 5776
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user