Skip to content

Commit f2cf260

Browse files
committed
fix compilation warning
1 parent 90c1b63 commit f2cf260

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

include/effectengine/AnimationBaseMusic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ struct MovingTarget
3131
int32_t _targetFastG;
3232
int32_t _targetFastB;
3333
int32_t _targetFastCounter;
34+
35+
void Clear();
3436
};
3537

3638
class AnimationBaseMusic : public AnimationBase

libsrc/effectengine/AnimationBaseMusic.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,23 @@ void AnimationBaseMusic::restore(MovingTarget* target) {
2626
memcpy(target, &_myTarget, sizeof(_myTarget));
2727
};
2828

29+
void MovingTarget::Clear()
30+
{
31+
_averageColor = QColor(0, 0, 0);
32+
_fastColor = QColor(0, 0, 0);
33+
_slowColor = QColor(0, 0, 0);
34+
_targetAverageR = 0;
35+
_targetAverageG = 0;
36+
_targetAverageB = 0;
37+
_targetAverageCounter = 0;
38+
_targetSlowR = 0;
39+
_targetSlowG = 0;
40+
_targetSlowB = 0;
41+
_targetSlowCounter = 0;
42+
_targetFastR = 0;
43+
_targetFastG = 0;
44+
_targetFastB = 0;
45+
_targetFastCounter = 0;
46+
};
47+
48+

libsrc/hyperhdrbase/SoundCapture.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ void SoundCaptureResult::Smooth()
462462
color[i].getRgb(&rr, &gg, &bb);
463463

464464

465-
r += std::max((rr * (_currentMax - 6*(_currentMax - buffScaledResult[i])))/_currentMax,0);
466-
g += std::max((gg * (_currentMax - 6*(_currentMax - buffScaledResult[i])))/_currentMax,0);
467-
b += std::max((bb * (_currentMax - 6*(_currentMax - buffScaledResult[i])))/_currentMax,0);
465+
r += std::max((rr * (_currentMax - 5*(_currentMax - buffScaledResult[i])))/_currentMax,0);
466+
g += std::max((gg * (_currentMax - 5*(_currentMax - buffScaledResult[i])))/_currentMax,0);
467+
b += std::max((bb * (_currentMax - 5*(_currentMax - buffScaledResult[i])))/_currentMax,0);
468468
}
469469

470470
int32_t ccScale = std::max(std::max(r, g), b);
@@ -681,8 +681,8 @@ void SoundCaptureResult::ResetData()
681681
_currentMax = 0;
682682

683683

684-
memset(&mtWorking, 0, sizeof(mtWorking));
685-
memset(&mtInternal, 0, sizeof(mtInternal));
684+
mtWorking.Clear();
685+
mtInternal.Clear();
686686
}
687687

688688
void SoundCaptureResult::GetBufResult(uint8_t* dest, size_t size) {

0 commit comments

Comments
 (0)