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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 100503006: Cleanup OPUS decoder. Remove extraneous transforms and copies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 years 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/ffmpeg/ffmpeg_common.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index fdfb45df916a5a1d3b376ceb9151b5b0c44d383a..6f8c0d354fb7e2939da4b9bdb4d15af8759225af 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -402,8 +402,19 @@ bool AudioRendererImpl::HandleSplicerBuffer(
if (state_ == kPrerolling && IsBeforePrerollTime(buffer))
return true;
- if (state_ != kUninitialized && state_ != kStopped)
+ if (state_ != kUninitialized && state_ != kStopped) {
+ if (state_ == kPrerolling) {
acolwell GONE FROM CHROMIUM 2013/12/12 23:46:19 nit: move this into the kPrerolling block above?
DaleCurtis 2013/12/13 03:19:11 Done.
+ // Trim off any additional time before the preroll timestamp.
+ const base::TimeDelta trim_time =
+ preroll_timestamp_ - buffer->timestamp();
+ if (trim_time > base::TimeDelta()) {
+ buffer->TrimStart(buffer->frame_count() *
+ (static_cast<double>(trim_time.InMicroseconds()) /
+ buffer->duration().InMicroseconds()));
+ }
+ }
algorithm_->EnqueueBuffer(buffer);
+ }
}
switch (state_) {
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698