fixed: track progress percentage for audio streams for which the player can't determi...
authorMartin van Beurden <chadoe@xbmc.org>
Sun, 8 Jul 2012 17:54:40 +0000 (19:54 +0200)
committerMartin van Beurden <chadoe@xbmc.org>
Sun, 8 Jul 2012 20:10:01 +0000 (22:10 +0200)
xbmc/Application.cpp

index e837809..c9f9a0d 100644 (file)
@@ -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