Hello Jeff
I will rename these variables to Hungarian notation. The audio playback
starts after it gets two filled buffers so I need to track the last two
buffers. This logic is based on extrapolating the time based on system
clock till the next buffer is filled so it needs tracking of reported time
and start time.
Thanks and regards
Pankaj Gupta
At 01:13 AM 4/29/2006, Jeff Ayars wrote:
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
Audio-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/audio-dev