equal
deleted
inserted
replaced
218 } |
218 } |
219 else |
219 else |
220 { |
220 { |
221 timePlayed = endTime-iStartTime; |
221 timePlayed = endTime-iStartTime; |
222 } |
222 } |
223 TUint32 bytesPlayed = (timePlayed*iPlayData.iSampleRate*KBytesPerSample)/iFCFrequency; |
223 TUint64 bytesPlayed = iPlayData.iSampleRate*KBytesPerSample; //A TUint64 is used because during the multiplying segment of the calculation we regularly overflow what a TUint32 can handle |
224 currentBytesPlayed = iBytesPlayed+bytesPlayed; |
224 bytesPlayed = (bytesPlayed * timePlayed)/iFCFrequency; //The division brings it back into TUint32 territory, however. We cannot do this before the multiplication without risking significant loss of accuracy |
|
225 |
|
226 currentBytesPlayed = iBytesPlayed+I64LOW(bytesPlayed); |
225 #ifdef SYMBIAN_SOUNDADAPTER_DEBUG |
227 #ifdef SYMBIAN_SOUNDADAPTER_DEBUG |
226 RDebug::Printf("EstimatedBytesPlayed[%d] Driver's bytesPlayed[%d]", currentBytesPlayed, iBytesPlayed); |
228 RDebug::Printf("EstimatedBytesPlayed[%d] Driver's bytesPlayed[%d]", currentBytesPlayed, iBytesPlayed); |
227 #endif |
229 #endif |
228 } |
230 } |
229 else |
231 else |