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

Unified Diff: media/cast/test/utility/generate_timecode_audio.cc

Issue 1477533002: Remove kint16max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint8max
Patch Set: includes Created 5 years, 1 month 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/base/audio_buffer_unittest.cc ('k') | net/disk_cache/blockfile/addr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/utility/generate_timecode_audio.cc
diff --git a/media/cast/test/utility/generate_timecode_audio.cc b/media/cast/test/utility/generate_timecode_audio.cc
index 219a8e1a1d27676e2ada337f88bee48fb39b2213..88d3fac80746ac4755ff5728437a90ed30d8b25d 100644
--- a/media/cast/test/utility/generate_timecode_audio.cc
+++ b/media/cast/test/utility/generate_timecode_audio.cc
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdint.h>
+
#include <algorithm>
#include <cstdio>
#include <cstdlib>
+#include <limits>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "media/cast/test/utility/audio_utility.h"
@@ -19,15 +21,16 @@ int main(int argc, char **argv) {
exit(1);
}
int fps = atoi(argv[1]);
- const uint32 frames = static_cast<uint32>(std::max(0, atoi(argv[2])));
+ const uint32_t frames = static_cast<uint32_t>(std::max(0, atoi(argv[2])));
std::vector<float> samples(kSamplingFrequency / fps);
size_t num_samples = 0;
- for (uint32 frame_id = 1; frame_id <= frames; frame_id++) {
+ for (uint32_t frame_id = 1; frame_id <= frames; frame_id++) {
CHECK(media::cast::EncodeTimestamp(
frame_id, num_samples, samples.size(), &samples.front()));
num_samples += samples.size();
for (size_t i = 0; i < samples.size(); ++i) {
- const int16 sample_s16 = static_cast<int16>(samples[i] * kint16max);
+ const int16_t sample_s16 = static_cast<int16_t>(
+ samples[i] * std::numeric_limits<int16_t>::max());
putchar(sample_s16 & 0xff);
putchar(sample_s16 >> 8);
putchar(sample_s16 & 0xff);
« no previous file with comments | « media/base/audio_buffer_unittest.cc ('k') | net/disk_cache/blockfile/addr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698