Only repaint the video slider on seek if the thumb will actually move

Cuts CPU usage for playback in totally arbitrary circumstances by about
5%.
This commit is contained in:
Thomas Goyne 2014-06-12 16:15:44 -07:00
parent 4bdccb889c
commit 633fa0e4d7
1 changed files with 4 additions and 2 deletions

View File

@ -67,8 +67,10 @@ VideoSlider::VideoSlider (wxWindow* parent, agi::Context *c)
void VideoSlider::SetValue(int value) {
if (val == value) return;
val = mid(0, value, max);
Refresh(false);
value = mid(0, value, max);
if (GetXAtValue(val) != GetXAtValue(value))
Refresh(false);
val = value;
}
void VideoSlider::VideoOpened(AsyncVideoProvider *provider) {