Permalink
Browse files

Return more accurate information about SampleRate

  • Loading branch information...
1 parent d92792f commit d224ce53317e14e5846b02d2c8a769bac472d231 @Karlson2k committed Jul 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/GUIInfoManager.cpp
View
@@ -3240,7 +3240,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item)
CStdString strSampleRate = "";
if (g_application.m_pPlayer->GetSampleRate() > 0)
{
- strSampleRate.Format("%i",g_application.m_pPlayer->GetSampleRate()/1000);
+ strSampleRate.Format("%.5g", ((double)g_application.m_pPlayer->GetSampleRate() / 1000.0));
}
return strSampleRate;
}

2 comments on commit d224ce5

Collaborator

jmarshallnz replied Jul 21, 2012

You probably want to use %f rather than %g.

Owner

Karlson2k replied Jul 22, 2012

I think that %g is better than %f as it skips any trailing zeros.
So we get 48 kHz, 44.1 kHz, 22.05 kHz and not 48.0, 44.1 and 22.1 or 48.00.
At the same time with all real possible rates we'll never get something like 12e+6 kHz. :)

Please sign in to comment.