Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Unified Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 2466463005: Support (E)AC3 passthrough
Patch Set: Add unit tests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/audio_sync_reader.cc
diff --git a/content/browser/renderer_host/media/audio_sync_reader.cc b/content/browser/renderer_host/media/audio_sync_reader.cc
index 18ac79d070666078c6e7d97280c1a5650d848e84..a699cb946e8994395ee76c4148690016dd6641ca 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -74,6 +74,7 @@ AudioSyncReader::AudioSyncReader(
reinterpret_cast<AudioOutputBuffer*>(shared_memory_->memory());
output_bus_ = AudioBus::WrapMemory(params, buffer->audio);
output_bus_->Zero();
+ output_bus_->set_is_bitstream_format(params.IsBitstreamFormat());
}
AudioSyncReader::~AudioSyncReader() {
@@ -212,8 +213,15 @@ void AudioSyncReader::Read(AudioBus* dest) {
if (mute_audio_)
DaleCurtis 2017/06/15 21:46:31 Just return instead of having else block.
AndyWu 2017/08/02 01:43:38 Done.
dest->Zero();
- else
+ else {
+ if (output_bus_->is_bitstream_format()) {
+ AudioOutputBuffer* buffer =
+ reinterpret_cast<AudioOutputBuffer*>(shared_memory_->memory());
+ output_bus_->set_frames(buffer->params.frames);
+ output_bus_->set_data_size(buffer->params.data_size);
+ }
output_bus_->CopyTo(dest);
+ }
}
void AudioSyncReader::Close() {

Powered by Google App Engine
This is Rietveld 408576698