Permalink
Browse files

fixed: track progress percentage for audio streams for which the play…

…er can't determine duration but with duration known in metadata. (was removed in dd02c0c).
  • Loading branch information...
1 parent bdbe25d commit 2f1834b92a615bfbe5e9057211cc898178359d0e @chadoe chadoe committed Jul 8, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 xbmc/Application.cpp
View
@@ -5409,6 +5409,13 @@ float CApplication::GetPercentage() const
{
if (IsPlaying() && m_pPlayer)
{
+ if (m_pPlayer->GetTotalTime() == 0 && IsPlayingAudio() && m_itemCurrentFile->HasMusicInfoTag())
+ {
+ const CMusicInfoTag& tag = *m_itemCurrentFile->GetMusicInfoTag();
+ if (tag.GetDuration() > 0)
+ return (float)(GetTime() / tag.GetDuration() * 100);
+ }
+
if (m_itemCurrentFile->IsStack() && m_currentStack->Size() > 0)
return (float)(GetTime() / GetTotalTime() * 100);
else

0 comments on commit 2f1834b

Please sign in to comment.