Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Commit

Permalink
Fix potential performance issues
Browse files Browse the repository at this point in the history
Allow 2 seconds of imprecision for duration. This might happen when we compute duration based on position and remaining time.
  • Loading branch information
ColinDuquesnoy committed Aug 27, 2017
1 parent 27ef457 commit e2261a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/MellowPlayer/Application/Player/Song.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Song.hpp"
#include <QDebug>

using namespace MellowPlayer::Application;

Expand Down Expand Up @@ -49,7 +50,7 @@ bool Song::isFavorite() const

void Song::setDuration(double value)
{
if (value == duration_)
if (abs(duration_ - value) < 2)
return;

duration_ = value;
Expand Down

0 comments on commit e2261a0

Please sign in to comment.