Fix drawWaveByMsecs when startmsecs or endmsecs are negative.

On ARM, the unsigned cast seems to be respected; on x64, apparently not. In RDLogEdit's Voice Tracker, this causes incorrect waveform display on ARM systems (https://github.com/ElvishArtisan/rivendell/issues/389)
This commit is contained in:
Robert Chipperfield 2021-10-26 19:23:09 +01:00
parent 554e07fcaa
commit b796bdc66e
No known key found for this signature in database
GPG Key ID: EE4F551F85CF5B7A

View File

@ -221,8 +221,8 @@ void RDWavePainter::drawWaveByMsecs(int x,int w,int startmsecs,int endmsecs,
int startclip,int endclip)
{
drawWaveBySamples(x,w,
(unsigned)((double)startmsecs*(double)wave_sample_rate/1000.0),
(unsigned)((double)endmsecs*(double)wave_sample_rate/1000.0),
(int)((double)startmsecs*(double)wave_sample_rate/1000.0),
(int)((double)endmsecs*(double)wave_sample_rate/1000.0),
gain,channel,color,
(int)((double)startclip*(double)wave_sample_rate/1000.0),
(int)((double)endclip*(double)wave_sample_rate/1000.0));