shithub: cstory

Download patch

ref: b68eb076ca57e489d38ba0ed128a113176d3c1f7
parent: 47543eb382060e858234335158cb6f2d63a7bcc4
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 3 11:00:07 EDT 2020

Rename a variable

--- a/src/Backends/Audio/SoftwareMixer.cpp
+++ b/src/Backends/Audio/SoftwareMixer.cpp
@@ -174,7 +174,7 @@
 			{
 			#ifdef LANCZOS_RESAMPLER
 				// Perform Lanczos resampling
-				float accumulator = 0;
+				float output_sample = 0;
 
 				for (int i = -LANCZOS_KERNEL_RADIUS + 1; i <= LANCZOS_KERNEL_RADIUS; ++i)
 				{
@@ -184,7 +184,7 @@
 
 					if (kernel_input == 0.0f)
 					{
-						accumulator += input_sample;
+						output_sample += input_sample;
 					}
 					else
 					{
@@ -191,13 +191,13 @@
 						const float nx = 3.14159265358979323846f * kernel_input;
 						const float nxa = nx / LANCZOS_KERNEL_RADIUS;
 
-						accumulator += input_sample * (sin(nx) * sin(nxa) / (nx * nxa));
+						output_sample += input_sample * (sin(nx) * sin(nxa) / (nx * nxa));
 					}
 				}
 
 				// Mix, and apply volume
-				*stream_pointer++ += (short)(accumulator * sound->volume_l);
-				*stream_pointer++ += (short)(accumulator * sound->volume_r);
+				*stream_pointer++ += (short)(output_sample * sound->volume_l);
+				*stream_pointer++ += (short)(output_sample * sound->volume_r);
 			#else
 				// Perform linear interpolation
 				const unsigned char interpolation_scale = sound->position_subsample >> 8;