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

Unified Diff: media/base/audio_latency.cc

Issue 2973763002: Revert of Make OS audio buffer size limits visible. (Closed)
Patch Set: Created 3 years, 5 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 | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/base/limits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_latency.cc
diff --git a/media/base/audio_latency.cc b/media/base/audio_latency.cc
index d0988faa32fb356331762ff899408269bc01048a..61b3724efa48cc36fc8ff7c3a545c95d7ba5bb56 100644
--- a/media/base/audio_latency.cc
+++ b/media/base/audio_latency.cc
@@ -11,11 +11,6 @@
#include "base/logging.h"
#include "base/time/time.h"
#include "build/build_config.h"
-#include "media/base/limits.h"
-
-#if defined(OS_MACOSX)
-#include "media/base/mac/audio_latency_mac.h"
-#endif
namespace media {
@@ -135,32 +130,16 @@
int AudioLatency::GetExactBufferSize(base::TimeDelta duration,
int sample_rate,
int hardware_buffer_size) {
+ const double requested_buffer_size = duration.InSecondsF() * sample_rate;
+
DCHECK_NE(0, hardware_buffer_size);
-
-// Other platforms do not currently support custom buffer sizes.
-#if !defined(OS_MACOSX) && !defined(USE_CRAS) && !defined(USE_PULSE)
- return hardware_buffer_size;
-#else
- const double requested_buffer_size = duration.InSecondsF() * sample_rate;
- int minimum_buffer_size = hardware_buffer_size;
-
-// On OSX and CRAS the preferred buffer size is larger than the minimum,
-// however we allow values down to the minimum if requested explicitly.
-#if defined(OS_MACOSX)
- minimum_buffer_size =
- GetMinAudioBufferSizeMacOS(limits::kMinAudioBufferSize, sample_rate);
-#elif defined(USE_CRAS)
- minimum_buffer_size = limits::kMinAudioBufferSize;
-#endif
// Round the requested size to the nearest multiple of the hardware size
const int buffer_size =
std::round(std::max(requested_buffer_size, 1.0) / hardware_buffer_size) *
hardware_buffer_size;
- return std::min(static_cast<int>(limits::kMaxAudioBufferSize),
- std::max(buffer_size, minimum_buffer_size));
-#endif
+ return std::max(buffer_size, hardware_buffer_size);
}
} // namespace media
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/base/limits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698