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

Unified Diff: media/base/audio_buffer.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/base/audio_buffer.cc
diff --git a/media/base/audio_buffer.cc b/media/base/audio_buffer.cc
index d563539ba07aac679662baba47b49db456208f8f..f77c2180c4b7c63624081aa7300605eacbf76e70 100644
--- a/media/base/audio_buffer.cc
+++ b/media/base/audio_buffer.cc
@@ -245,9 +245,17 @@ void AudioBuffer::ReadFrames(int frames_to_copy,
DCHECK_EQ(dest->channels(), channel_count_);
DCHECK_LE(source_frame_offset + frames_to_copy, adjusted_frame_count_);
+ dest->set_is_bitstream_format(IsBitstreamFormat());
DaleCurtis 2017/06/15 21:46:32 Move into l.251 as set_is_bitstream_format(true);
AndyWu 2017/08/02 01:43:40 Not really sure it's a good idea to assume the sta
+
if (IsBitstreamFormat()) {
- // TODO(tsunghung): Implement it along with AudioBus changes.
- NOTREACHED() << "Invalid sample format!";
+ DCHECK(!source_frame_offset);
+ uint8_t* dest_data =
+ reinterpret_cast<uint8_t*>(dest->channel(0)) + dest->data_size();
+
+ memcpy(dest_data, channel_data_[0], data_size());
+ dest->set_data_size(dest_frame_offset + data_size());
+ dest->set_frames(dest->frames() + frame_count());
+ return;
}
DCHECK_LE(dest_frame_offset + frames_to_copy, dest->frames());

Powered by Google App Engine
This is Rietveld 408576698