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

Unified Diff: media/filters/audio_renderer_base.cc

Issue 1581008: Audio cut off ~500ms too early (Closed)
Patch Set: missing patch Created 10 years, 9 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 | « chrome/renderer/media/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_base.cc
diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc
index 712fc45af3e01c12e57aba8e8fbe30bf2ec60986..f07a4c2ca326de632052948863ff0a48d20c55c1 100644
--- a/media/filters/audio_renderer_base.cc
+++ b/media/filters/audio_renderer_base.cc
@@ -192,8 +192,10 @@ uint32 AudioRendererBase::FillBuffer(uint8* dest,
last_fill_buffer_time = last_fill_buffer_time_;
last_fill_buffer_time_ = base::TimeDelta();
- // Check if we finally reached end of stream by emptying |algorithm_|.
- if (algorithm_->IsQueueEmpty()) {
+ // Use two conditions to determine the end of playback:
+ // 1. Algorithm has no audio data.
+ // 2. Browser process has no audio data.
+ if (algorithm_->IsQueueEmpty() && !playback_delay.ToInternalValue()) {
if (recieved_end_of_stream_ && !rendered_end_of_stream_) {
rendered_end_of_stream_ = true;
host()->NotifyEnded();
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698