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

Unified Diff: media/filters/audio_renderer_algorithm.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/filters/audio_renderer_algorithm.cc
diff --git a/media/filters/audio_renderer_algorithm.cc b/media/filters/audio_renderer_algorithm.cc
index fe30e80add0c81ac61903bb7731719dd53fa2a60..f214c00cc2256cdbec0e993193fd90140670bd58 100644
--- a/media/filters/audio_renderer_algorithm.cc
+++ b/media/filters/audio_renderer_algorithm.cc
@@ -77,6 +77,7 @@ static const int kStartingCapacityForEncryptedInMs = 500;
AudioRendererAlgorithm::AudioRendererAlgorithm()
: channels_(0),
samples_per_second_(0),
+ is_bitstream_format_(false),
muted_partial_frame_(0),
capacity_(0),
output_time_(0.0),
@@ -98,6 +99,7 @@ void AudioRendererAlgorithm::Initialize(const AudioParameters& params,
channels_ = params.channels();
samples_per_second_ = params.sample_rate();
+ is_bitstream_format_ = params.IsBitstreamFormat();
initial_capacity_ = capacity_ = std::max(
params.frames_per_buffer() * 2,
ConvertMillisecondsToFrames(is_encrypted
@@ -157,6 +159,14 @@ int AudioRendererAlgorithm::FillBuffer(AudioBus* dest,
DCHECK_GT(playback_rate, 0);
DCHECK_EQ(channels_, dest->channels());
+ dest->set_is_bitstream_format(is_bitstream_format_);
chcunningham 2017/06/14 20:03:08 this block too could use some documentation for fu
AndyWu 2017/08/02 01:43:41 Done.
+ if (is_bitstream_format_) {
+ dest->set_data_size(0);
DaleCurtis 2017/06/15 21:46:32 Why?
AndyWu 2017/08/02 01:43:40 Removed.
+ dest->set_frames(0);
+
+ return audio_buffer_.ReadFrames(requested_frames, dest_offset, dest);
+ }
+
// Optimize the muted case to issue a single clear instead of performing
// the full crossfade and clearing each crossfaded frame.
if (playback_rate < kMinPlaybackRate || playback_rate > kMaxPlaybackRate) {

Powered by Google App Engine
This is Rietveld 408576698