mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 09:35:35 +00:00
clip audio correctly in gigaherz' resampler
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@929 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
d3660be648
commit
e1baf2ead4
@ -165,8 +165,14 @@ void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate) {
|
||||
DataL = t3l;
|
||||
DataR = t3r;
|
||||
}
|
||||
sample_queue.push(DataL);
|
||||
sample_queue.push(DataR);
|
||||
|
||||
int l = DataL, r = DataR;
|
||||
if (l < -32767) l = -32767;
|
||||
if (r < -32767) r = -32767;
|
||||
if (l > 32767) l = 32767;
|
||||
if (r > 32767) r = 32767;
|
||||
sample_queue.push(l);
|
||||
sample_queue.push(r);
|
||||
queue_size += 2;
|
||||
}
|
||||
push_sync.Leave();
|
||||
|
@ -151,9 +151,14 @@ void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate) {
|
||||
DataL = t3l;
|
||||
DataR = t3r;
|
||||
}
|
||||
sample_queue.push(DataL);
|
||||
sample_queue.push(DataR);
|
||||
queue_size += 2;
|
||||
|
||||
int l = DataL, r = DataR;
|
||||
if (l < -32767) l = -32767;
|
||||
if (r < -32767) r = -32767;
|
||||
if (l > 32767) l = 32767;
|
||||
if (r > 32767) r = 32767;
|
||||
sample_queue.push(l);
|
||||
sample_queue.push(r);
|
||||
}
|
||||
push_sync.Leave();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user