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

Unified Diff: media/filters/audio_renderer_base.cc

Issue 164195: Merge 21935 - Fixes an audio playback regression caused by seeking in audio/v... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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
===================================================================
--- media/filters/audio_renderer_base.cc (revision 22805)
+++ media/filters/audio_renderer_base.cc (working copy)
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "media/base/filter_host.h"
#include "media/filters/audio_renderer_base.h"
@@ -144,7 +146,14 @@
// 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.
+ const size_t kZeroLength = 8192;
+ dest_written = std::min(kZeroLength, dest_len);
+ memset(dest, 0, dest_written);
+ return dest_written;
}
// Save a local copy of last fill buffer time and reset the member.
Property changes on: media\filters\audio_renderer_base.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/media/filters/audio_renderer_base.cc:r21935
« 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