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

Unified Diff: media/base/audio_block_fifo.cc

Issue 2865113007: Remove ScopedVector from media/base/ (Closed)
Patch Set: added header file in text_renderer_unittest.cc Created 3 years, 7 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
« no previous file with comments | « media/base/audio_block_fifo.h ('k') | media/base/audio_converter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_block_fifo.cc
diff --git a/media/base/audio_block_fifo.cc b/media/base/audio_block_fifo.cc
index be15fb11638729c914ba9293e092c9d5b0e140c7..411fa6078de578ddf83c8df4440585c4a27d839e 100644
--- a/media/base/audio_block_fifo.cc
+++ b/media/base/audio_block_fifo.cc
@@ -36,7 +36,7 @@ void AudioBlockFifo::PushSilence(int frames) {
const AudioBus* AudioBlockFifo::Consume() {
DCHECK(available_blocks_);
- AudioBus* audio_bus = audio_blocks_[read_block_];
+ AudioBus* audio_bus = audio_blocks_[read_block_].get();
read_block_ = (read_block_ + 1) % audio_blocks_.size();
--available_blocks_;
return audio_bus;
@@ -67,10 +67,8 @@ void AudioBlockFifo::IncreaseCapacity(int blocks) {
audio_blocks_.reserve(audio_blocks_.size() + blocks);
const int original_size = audio_blocks_.size();
- for (int i = 0; i < blocks; ++i) {
- audio_blocks_.push_back(
- AudioBus::Create(channels_, block_frames_).release());
- }
+ for (int i = 0; i < blocks; ++i)
+ audio_blocks_.push_back(AudioBus::Create(channels_, block_frames_));
if (!original_size)
return;
@@ -103,7 +101,7 @@ void AudioBlockFifo::PushInternal(const void* source,
int frames_to_push = frames;
while (frames_to_push) {
// Get the current write block.
- AudioBus* current_block = audio_blocks_[write_block_];
+ AudioBus* current_block = audio_blocks_[write_block_].get();
// Figure out what segment sizes we need when adding the new content to
// the FIFO.
« no previous file with comments | « media/base/audio_block_fifo.h ('k') | media/base/audio_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698