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

Unified Diff: media/audio/audio_util.cc

Issue 10466007: Fix wrong timing when audio is muted. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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
Index: media/audio/audio_util.cc
===================================================================
--- media/audio/audio_util.cc (revision 140286)
+++ media/audio/audio_util.cc (working copy)
@@ -260,7 +260,7 @@
void InterleaveFloatToInt(const std::vector<float*>& source, void* dst,
size_t number_of_frames, int bytes_per_sample) {
- switch(bytes_per_sample) {
+ switch (bytes_per_sample) {
case 1:
InterleaveFloatToInt<uint8, int32>(source, dst, number_of_frames);
break;
@@ -281,7 +281,9 @@
// when we have to adjust volume as well.
template<class Format, class Fixed, int min_value, int max_value, int bias>
static void MixStreams(Format* dst, Format* src, int count, float volume) {
- if (volume == 1.0f) {
+ if (volume == 0.0f) {
+ return;
+ } else if (volume == 1.0f) {
scherkus (not reviewing) 2012/06/04 20:52:51 nit: no need for else
// Most common case -- no need to adjust volume.
for (int i = 0; i < count; ++i) {
Fixed value = AddSaturated<Fixed, min_value, max_value>(dst[i] - bias,
« media/audio/audio_output_mixer.cc ('K') | « media/audio/audio_output_proxy_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698