Skip to content

Commit

Permalink
VideoPlayer: fix message queue signal level of zero when not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta authored and popcornmix committed Jan 4, 2016
1 parent f6a36fa commit c501104
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xbmc/cores/VideoPlayer/DVDMessageQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,16 @@ int CDVDMessageQueue::GetLevel() const
if(IsDataBased())
return std::min(100, 100 * m_iDataSize / m_iMaxDataSize);

return std::min(100, MathUtils::round_int(100.0 * m_TimeSize * (m_TimeFront - m_TimeBack) / DVD_TIME_BASE ));
int level = std::min(100, MathUtils::round_int(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");
return 1;
}

return level;
}

int CDVDMessageQueue::GetTimeSize() const
Expand Down

0 comments on commit c501104

Please sign in to comment.