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

Unified Diff: webrtc/common_audio/wav_file.h

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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 | « webrtc/common_audio/resampler/resampler.cc ('k') | webrtc/common_audio/wav_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/wav_file.h
diff --git a/webrtc/common_audio/wav_file.h b/webrtc/common_audio/wav_file.h
index eb2ce1e31d9e8bd431abd072ff705528025d4ac0..e656eb8643e5af18ccaaca48bd215021e99ff6bc 100644
--- a/webrtc/common_audio/wav_file.h
+++ b/webrtc/common_audio/wav_file.h
@@ -27,7 +27,7 @@ class WavFile {
virtual ~WavFile() {}
virtual int sample_rate() const = 0;
- virtual int num_channels() const = 0;
+ virtual size_t num_channels() const = 0;
virtual size_t num_samples() const = 0;
// Returns a human-readable string containing the audio format.
@@ -39,7 +39,7 @@ class WavFile {
class WavWriter final : public WavFile {
public:
// Open a new WAV file for writing.
- WavWriter(const std::string& filename, int sample_rate, int num_channels);
+ WavWriter(const std::string& filename, int sample_rate, size_t num_channels);
// Close the WAV file, after writing its header.
~WavWriter();
@@ -51,13 +51,13 @@ class WavWriter final : public WavFile {
void WriteSamples(const int16_t* samples, size_t num_samples);
int sample_rate() const override { return sample_rate_; }
- int num_channels() const override { return num_channels_; }
+ size_t num_channels() const override { return num_channels_; }
size_t num_samples() const override { return num_samples_; }
private:
void Close();
const int sample_rate_;
- const int num_channels_;
+ const size_t num_channels_;
size_t num_samples_; // Total number of samples written to file.
FILE* file_handle_; // Output file, owned by this class
@@ -79,13 +79,13 @@ class WavReader final : public WavFile {
size_t ReadSamples(size_t num_samples, int16_t* samples);
int sample_rate() const override { return sample_rate_; }
- int num_channels() const override { return num_channels_; }
+ size_t num_channels() const override { return num_channels_; }
size_t num_samples() const override { return num_samples_; }
private:
void Close();
int sample_rate_;
- int num_channels_;
+ size_t num_channels_;
size_t num_samples_; // Total number of samples in the file.
size_t num_samples_remaining_;
FILE* file_handle_; // Input file, owned by this class.
@@ -102,13 +102,13 @@ extern "C" {
typedef struct rtc_WavWriter rtc_WavWriter;
rtc_WavWriter* rtc_WavOpen(const char* filename,
int sample_rate,
- int num_channels);
+ size_t num_channels);
void rtc_WavClose(rtc_WavWriter* wf);
void rtc_WavWriteSamples(rtc_WavWriter* wf,
const float* samples,
size_t num_samples);
int rtc_WavSampleRate(const rtc_WavWriter* wf);
-int rtc_WavNumChannels(const rtc_WavWriter* wf);
+size_t rtc_WavNumChannels(const rtc_WavWriter* wf);
size_t rtc_WavNumSamples(const rtc_WavWriter* wf);
#ifdef __cplusplus
« no previous file with comments | « webrtc/common_audio/resampler/resampler.cc ('k') | webrtc/common_audio/wav_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698