Work around incorrect channel count for raw audio
The raw audio decoder's output audio format is stereo when the number of input channels is (for example) 10 channels. Add a temporary workaround that uses the input channel count for raw audio. This code should be removed in future when we bypass the decoder entirely for raw audio. Tested manually on a WAVE file with 18 audio channels. PiperOrigin-RevId: 625307624
This commit is contained in:
parent
ea48fe579e
commit
3be49a5841
@ -11,6 +11,8 @@
|
||||
* Add `reset` to `BasePreloadManager` to release all the holding sources
|
||||
while keep the preload manager instance.
|
||||
* Transformer:
|
||||
* Work around a decoder bug where the number of audio channels was capped
|
||||
at stereo when handling PCM input.
|
||||
* Track Selection:
|
||||
* Extractors:
|
||||
* Audio:
|
||||
|
@ -262,6 +262,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
if (decoderOutputFormat == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: b/332708880 - The raw decoder caps number of audio channels to stereo. Remove this
|
||||
// workaround and bypass MediaCodec for raw audio instead.
|
||||
if (checkNotNull(inputFormat.sampleMimeType).equals(MimeTypes.AUDIO_RAW)) {
|
||||
decoderOutputFormat =
|
||||
decoderOutputFormat.buildUpon().setChannelCount(inputFormat.channelCount).build();
|
||||
}
|
||||
|
||||
outputFormat = overrideOutputFormat(decoderOutputFormat);
|
||||
} else {
|
||||
// TODO(b/278259383): Move surface creation out of video sampleConsumer. Init decoder and
|
||||
|
Loading…
x
Reference in New Issue
Block a user