Commit efc42a28 authored by Volodymyr Riazantsev's avatar Volodymyr Riazantsev Committed by Commit Bot

[Chromecast] cma: mixer: Don't fail on non-float audio buffers

If audio stream is not in float format we can process audio buffers by
taking the same route as an audio data processing. This can happen if
audio buffers are supplied within the same process and we are using
external buffer pool.

Bug: internal b/159173611
Test: cast_audio_backend_unittests; run GVA config on the reference device
Signed-off-by: default avatarVolodymyr Riazantsev <riazantsevv@google.com>
Change-Id: I0548fc81960313f95f1c609f9e3676da0af3774e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391284Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804980}
parent 2bc4ba08
...@@ -358,7 +358,9 @@ bool MixerInputConnection::HandleAudioBuffer( ...@@ -358,7 +358,9 @@ bool MixerInputConnection::HandleAudioBuffer(
} }
DCHECK_EQ(data - buffer->data(), kAudioMessageHeaderSize); DCHECK_EQ(data - buffer->data(), kAudioMessageHeaderSize);
DCHECK_EQ(sample_format_, mixer_service::SAMPLE_FORMAT_FLOAT_P); if (sample_format_ != mixer_service::SAMPLE_FORMAT_FLOAT_P) {
return HandleAudioData(data, size, timestamp);
}
int32_t num_frames = size / (sizeof(float) * num_channels_); int32_t num_frames = size / (sizeof(float) * num_channels_);
DCHECK_EQ(sizeof(int32_t), 4u); DCHECK_EQ(sizeof(int32_t), 4u);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment