At 09:51 AM 4/13/2006, Greg Wright wrote:
Pankaj Gupta wrote:
Thanks Rajesh
Find below updated CVS Diff . I changed the logic of time computation and it is now based on samples written in to the buffer instead of SamplesPlayed() symbian call. I observed that audio device start playing after it gets two buffer filled. In this logic I added three sample count member which keep track of last 3 buffers. As soon as two buffers are filled by BufferToBeFilled() function the current tick count is recorded. The deltaTime is computed based on this tickcount and sent in subsequent getTime calls based on the lasttolast buffer time. Each time a new buffer is completed the reference time is shifted to the next buffer time and all delta time are now calculated based on this buffer. It will help in resetting the error accrued in computing the delta time and also helps in handling Pause. The old logic of SamplesPlayed is also kept under #if defined HELIX_CONFIG_SYMBIAN_SAMPLESPLAYED and it can be activated by defining this constant.
Let me know your suggestions.

CVS Diff

Index: audio_session-mmf.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/symbian/audiosvr/mmf/audio_session-mmf.cpp,v
retrieving revision 1.4.2.6
diff -u -r1.4.2.6 audio_session-mmf.cpp
--- audio_session-mmf.cpp       20 Apr 2005 23:50:58 -0000      1.4.2.6
+++ audio_session-mmf.cpp       13 Apr 2006 12:59:14 -0000
@@ -201,12 +201,21 @@
     m_pPendingFillBuffer(NULL),
     m_cbFrontBufferWritten(0),
     m_samplesWritten(0),
+#if defined HELIX_CONFIG_SYMBIAN_SAMPLESPLAYED
     m_lastSampleCount(0),
     m_unplayedSampleCount(0),
     m_msTimePlayed(0),
     m_sampleCountResetPending(FALSE),
     m_resetTriggerSampleCount(0),
     m_resetTriggerUnplayedCount(0)
+#else
+    m_TotalSamplesWritten(0),
+    m_ulStartTime(0),
+    m_TotalSamplesFillLastToLastBuff(0),
+    m_TotalSamplesFillLastBuff(0),
+    m_TotalSamplesFillBuff(0),
+    m_ulReportedTime(0)
+#endif
 {

How about following the Hungarian for these new members. Do we really need to grow the class instance by this many variables?

JEff


_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to