mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibAudio: Improve local variable names
This makes the code easier to read.
This commit is contained in:
parent
b6d075bb01
commit
8945cc8358
Notes:
sideshowbarker
2024-07-18 01:22:19 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/8945cc83583 Pull-request: https://github.com/SerenityOS/serenity/pull/10721 Reviewed-by: https://github.com/bgianfo
@ -47,14 +47,14 @@ i32 Buffer::allocate_id()
|
||||
template<typename SampleReader>
|
||||
static void read_samples_from_stream(InputMemoryStream& stream, SampleReader read_sample, Vector<Sample>& samples, int num_channels)
|
||||
{
|
||||
double norm_l = 0;
|
||||
double norm_r = 0;
|
||||
double left_channel_sample = 0;
|
||||
double right_channel_sample = 0;
|
||||
|
||||
switch (num_channels) {
|
||||
case 1:
|
||||
for (;;) {
|
||||
norm_l = read_sample(stream);
|
||||
samples.append(Sample(norm_l));
|
||||
left_channel_sample = read_sample(stream);
|
||||
samples.append(Sample(left_channel_sample));
|
||||
|
||||
if (stream.handle_any_error()) {
|
||||
break;
|
||||
@ -63,9 +63,9 @@ static void read_samples_from_stream(InputMemoryStream& stream, SampleReader rea
|
||||
break;
|
||||
case 2:
|
||||
for (;;) {
|
||||
norm_l = read_sample(stream);
|
||||
norm_r = read_sample(stream);
|
||||
samples.append(Sample(norm_l, norm_r));
|
||||
left_channel_sample = read_sample(stream);
|
||||
right_channel_sample = read_sample(stream);
|
||||
samples.append(Sample(left_channel_sample, right_channel_sample));
|
||||
|
||||
if (stream.handle_any_error()) {
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user