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

Unified Diff: media/audio/audio_output_device.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: media/audio/audio_output_device.cc
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc
index 1013ce6ad731a33aae3f05b0d4c83eef0c94ad40..90c3c3480ad60042507d6be23b34e43d390cc309 100644
--- a/media/audio/audio_output_device.cc
+++ b/media/audio/audio_output_device.cc
@@ -494,12 +494,23 @@ void AudioOutputDevice::AudioThreadCallback::Process(uint32_t control_signal) {
DVLOG(4) << __func__ << " delay:" << delay << " delay_timestamp:" << delay
<< " frames_skipped:" << frames_skipped;
+ output_bus_->set_is_bitstream_format(audio_parameters_.IsBitstreamFormat());
DaleCurtis 2017/06/15 21:46:31 if (audio_parameters_.IsBitstreamFormat()) { out
AndyWu 2017/08/02 01:43:39 Done.
+ if (audio_parameters_.IsBitstreamFormat()) {
+ // Reset the data size and frame count.
+ // For compressed audio formats, the data size and frame count will be
+ // updated by |render_callback_|.
+ output_bus_->set_data_size(0);
+ output_bus_->set_frames(audio_parameters_.frames_per_buffer());
+ }
+
// Update the audio-delay measurement, inform about the number of skipped
// frames, and ask client to render audio. Since |output_bus_| is wrapping
// the shared memory the Render() call is writing directly into the shared
// memory.
render_callback_->Render(delay, delay_timestamp, frames_skipped,
output_bus_.get());
+ buffer->params.frames = output_bus_->frames();
DaleCurtis 2017/06/15 21:46:31 Hmm, this is always audio_parameters_.frames_per_b
AndyWu 2017/08/02 01:43:39 To make things clear, I changed to GetBitstreamFra
+ buffer->params.data_size = output_bus_->data_size();
}
bool AudioOutputDevice::AudioThreadCallback::

Powered by Google App Engine
This is Rietveld 408576698