diff options
| author | degasus <wickmarkus@web.de> | 2013-01-24 16:58:28 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2013-01-24 16:58:28 +0100 |
| commit | e0ffdda26e5fb34b2f0d59d5d45b0deda9c90c19 (patch) | |
| tree | 8e289ea93c97fe7430ae501200b60327f572c7e2 /Source/Core/AudioCommon/Src/WaveFile.cpp | |
| parent | d5748ebaef93cd601ae6ab5e12f39dd201593ad0 (diff) | |
| parent | d60cc373d1b389215eb63c4e20fe24e902680c7a (diff) | |
Merge branch 'immediate-removal' into GLSL-master
Conflicts:
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp
immediate-removal is a new created branch seperated from master but reverted the revert of immediate-removal
so we get less conflicts by merging
Diffstat (limited to 'Source/Core/AudioCommon/Src/WaveFile.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/Src/WaveFile.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/Source/Core/AudioCommon/Src/WaveFile.cpp b/Source/Core/AudioCommon/Src/WaveFile.cpp index 802f3f7417..d98348b8bf 100644 --- a/Source/Core/AudioCommon/Src/WaveFile.cpp +++ b/Source/Core/AudioCommon/Src/WaveFile.cpp @@ -100,39 +100,52 @@ void WaveFileWriter::Write4(const char *ptr) file.WriteBytes(ptr, 4); } -void WaveFileWriter::AddStereoSamples(const short *sample_data, int count) +void WaveFileWriter::AddStereoSamples(const short *sample_data, u32 count) { if (!file) PanicAlertT("WaveFileWriter - file not open."); - if (skip_silence) { + + if (skip_silence) + { bool all_zero = true; - for (int i = 0; i < count * 2; i++) - if (sample_data[i]) all_zero = false; - if (all_zero) return; + + for (u32 i = 0; i < count * 2; i++) + { + if (sample_data[i]) + all_zero = false; + } + + if (all_zero) + return; } + file.WriteBytes(sample_data, count * 4); audio_size += count * 4; } -void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, int count) +void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count) { if (!file) PanicAlertT("WaveFileWriter - file not open."); if (count > BUF_SIZE * 2) - PanicAlert("WaveFileWriter - buffer too small (count = %i).", count); + PanicAlert("WaveFileWriter - buffer too small (count = %u).", count); if (skip_silence) { bool all_zero = true; - for (int i = 0; i < count * 2; i++) + + for (u32 i = 0; i < count * 2; i++) + { if (sample_data[i]) all_zero = false; + } + if (all_zero) return; } - for (int i = 0; i < count * 2; i++) + for (u32 i = 0; i < count * 2; i++) conv_buffer[i] = Common::swap16((u16)sample_data[i]); file.WriteBytes(conv_buffer, count * 4); |
