Skip to content

Commit

Permalink
VideoPlayer: DVDMessageQueue, round up instead to the nearest integer
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jul 13, 2016
1 parent 22b42e1 commit 3ac6580
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xbmc/cores/VideoPlayer/DVDMessageQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "utils/log.h"
#include "threads/SingleLock.h"
#include "DVDClock.h"
#include "utils/MathUtils.h"
#include "math.h"

CDVDMessageQueue::CDVDMessageQueue(const std::string &owner) : m_hEvent(true), m_owner(owner)
{
Expand Down Expand Up @@ -262,12 +262,12 @@ int CDVDMessageQueue::GetLevel() const
if (IsDataBased())
return std::min(100, 100 * m_iDataSize / m_iMaxDataSize);

int level = std::min(100, MathUtils::round_int(100.0 * m_TimeSize * (m_TimeFront - m_TimeBack) / DVD_TIME_BASE ));
int level = std::min(100.0, ceil(100.0 * m_TimeSize * (m_TimeFront - m_TimeBack) / DVD_TIME_BASE ));

// if we added lots of packets with NOPTS, make sure that the queue is not signalled empty
if (level == 0 && m_iDataSize != 0)
{
CLog::Log(LOGNOTICE, "CDVDMessageQueue::GetLevel() - can't determine level");
CLog::Log(LOGDEBUG, "CDVDMessageQueue::GetLevel() - can't determine level");
return 1;
}

Expand Down

0 comments on commit 3ac6580

Please sign in to comment.