Permalink
Browse files

[IOS/ATV2] fixed audio render cache time calculation

GetCacheTime is using GetSpace. GetSpace calculates the size
based on input and output channels. Do the same in GetCacheTime.
  • Loading branch information...
huceke
huceke committed Oct 9, 2011
1 parent be32e6d commit 431d3d06161277e5d9dd75a9aa3a6dc6e30be393
Showing with 2 additions and 1 deletion.
  1. +2 −1 xbmc/cores/AudioRenderers/IOSAudioRenderer.cpp
@@ -325,7 +325,8 @@ float CIOSAudioRenderer::GetDelay()
float CIOSAudioRenderer::GetCacheTime()
{
- return (float)(m_BufferLen - GetSpace()) / (float)m_BytesPerSec;
+ unsigned int nBufferLenFull = (m_BufferLen / m_Channels) * m_DataChannels;
+ return (float)(nBufferLenFull - GetSpace()) / (float)m_BytesPerSec;
}
float CIOSAudioRenderer::GetCacheTotal()

0 comments on commit 431d3d0

Please sign in to comment.