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

Side by Side Diff: media/base/fake_audio_render_callback.cc

Issue 14189035: Reduce jitter from uneven SincResampler buffer size requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/audio_converter_unittest.cc ('k') | media/base/multi_channel_resampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "media/base/fake_audio_render_callback.h" 10 #include "media/base/fake_audio_render_callback.h"
(...skipping 25 matching lines...) Expand all
36 // Copy first channel into the rest of the channels. 36 // Copy first channel into the rest of the channels.
37 for (int i = 1; i < audio_bus->channels(); ++i) 37 for (int i = 1; i < audio_bus->channels(); ++i)
38 memcpy(audio_bus->channel(i), audio_bus->channel(0), 38 memcpy(audio_bus->channel(i), audio_bus->channel(0),
39 number_of_frames * sizeof(*audio_bus->channel(i))); 39 number_of_frames * sizeof(*audio_bus->channel(i)));
40 40
41 return number_of_frames; 41 return number_of_frames;
42 } 42 }
43 43
44 double FakeAudioRenderCallback::ProvideInput(AudioBus* audio_bus, 44 double FakeAudioRenderCallback::ProvideInput(AudioBus* audio_bus,
45 base::TimeDelta buffer_delay) { 45 base::TimeDelta buffer_delay) {
46 Render(audio_bus, buffer_delay.InMilliseconds()); 46 Render(audio_bus, buffer_delay.InMillisecondsF() + 0.5);
47 return volume_; 47 return volume_;
48 } 48 }
49 49
50 } // namespace media 50 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_converter_unittest.cc ('k') | media/base/multi_channel_resampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698