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

Unified Diff: media/filters/audio_renderer_base.cc

Issue 160283: Fixes an audio playback regression caused by seeking in audio/video media. (Closed)
Patch Set: Created 11 years, 5 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 5726bb12f34d7259a9d19250f2a55c57f158e71d..baef036ac4472b105e7f30f093b488ce9dcf6d89 100644
--- a/media/filters/audio_renderer_base.cc
+++ b/media/filters/audio_renderer_base.cc
@@ -144,7 +144,13 @@ size_t AudioRendererBase::FillBuffer(uint8* dest,
// Mute audio by returning 0 when not playing.
if (state_ != kPlaying) {
- return 0;
+ // TODO(scherkus): To keep the audio hardware busy we write at most 8k of
+ // zeros. This gets around the tricky situation of pausing and resuming
+ // the audio IPC layer in Chrome. Ideally, we should return zero and then
+ // the subclass can restart the conversation.
+ dest_written = std::min(8192u, dest_len);
+ memset(dest, 0, dest_written);
+ return dest_written;
}
// Save a local copy of last fill buffer time and reset the member.
« 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