aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-08 21:15:31 +0800
committerchai <chaifix@163.com>2018-10-08 21:15:31 +0800
commit92324d145d804a963e8858a5daac18085553c6c9 (patch)
tree8819721a47780763078cdba1fb03215ea2ccf94b /src
parent75fa36f51921376f13203bf49fee887f0474e414 (diff)
*格式化代码
Diffstat (limited to 'src')
-rw-r--r--src/libjin/Audio/SDL/SDLSource.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libjin/Audio/SDL/SDLSource.cpp b/src/libjin/Audio/SDL/SDLSource.cpp
index 251ef27..9f4f2fb 100644
--- a/src/libjin/Audio/SDL/SDLSource.cpp
+++ b/src/libjin/Audio/SDL/SDLSource.cpp
@@ -290,21 +290,21 @@ Manager::get()->pushCommand(cmd); \
for (int i = 0; i < samples; ++i)
{
char* source = (char*)raw.data + status.pos * (raw.bitdepth / 8) * raw.channels;
- short left = 0;
- short right = 0;
+ short l = 0;
+ short r = 0;
if (raw.bitdepth == 16)
{
- left = ((short*)source)[L] * status.volume;
- right = ((short*)source)[L + raw.channels - 1] * status.volume;
+ l = ((short*)source)[L] * status.volume;
+ r = ((short*)source)[L + raw.channels - 1] * status.volume;
}
else if (raw.bitdepth == 8)
{
- left = source[L] << 8; // << 8 Ŵ16bits
- right = source[L + raw.channels - 1] << 8;
+ l = source[L] << 8; // << 8 Ŵ16bits
+ r = source[L + raw.channels - 1] << 8;
}
short* sample = buffer + (i << 1);
- sample[L] = clamp(sample[L] + left, SHRT_MIN, SHRT_MAX); //
- sample[R] = clamp(sample[R] + right, SHRT_MIN, SHRT_MAX); //
+ sample[L] = clamp(sample[L] + l, SHRT_MIN, SHRT_MAX); //
+ sample[R] = clamp(sample[R] + r, SHRT_MIN, SHRT_MAX); //
++status.pos;
if (status.pos > raw.samples && status.loop)
status.pos = 0; // rewind