Chromium Code Reviews| 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, |