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:
hrydgard 2008-10-21 20:27:37 +00:00
parent d3660be648
commit e1baf2ead4
2 changed files with 16 additions and 5 deletions

View File

@ -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();

View File

@ -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();
}