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_) { |