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

Unified Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 7762012: Fix audio glitch when audio stream first starts up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_sync_reader.cc
===================================================================
--- content/browser/renderer_host/media/audio_sync_reader.cc (revision 98490)
+++ content/browser/renderer_host/media/audio_sync_reader.cc (working copy)
@@ -33,6 +33,10 @@
// Get the data from the buffer.
memcpy(data, shared_memory_->memory(), read_size);
+ // If amount read was less than requested, then zero out the remainder.
+ if (read_size < size)
+ memset(static_cast<char*>(data) + read_size, 0, size - read_size);
+
// Zero out the entire buffer.
memset(shared_memory_->memory(), 0, max_size);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698