Bug 3673 - Seeking via grabbing the Music Player progress bar does not work. RCL_3 tip
authorTapani Kanerva <tapani.kanerva@nice.fi>
Tue, 16 Nov 2010 14:11:25 +0200
branchRCL_3
changeset 67 b35006be8823
parent 65 af86cc8a4692
Bug 3673 - Seeking via grabbing the Music Player progress bar does not work.
mmlibs/mmfw/src/server/BaseClasses/mmfdatapath2.cpp
--- a/mmlibs/mmfw/src/server/BaseClasses/mmfdatapath2.cpp	Wed Oct 13 16:15:10 2010 +0300
+++ b/mmlibs/mmfw/src/server/BaseClasses/mmfdatapath2.cpp	Tue Nov 16 14:11:25 2010 +0200
@@ -547,7 +547,10 @@
 	if(iGetTimePlayedSupported)
 		{
 		TTimeIntervalMicroSeconds timePlayed(0);
-		if(iState == EPlaying && iDataSink->DataSinkType() == KUidMmfAudioOutput)
+		if(iState == EPlaying 
+			|| (iState == EPrimed && iPauseCalled)
+			&& iDataSink->DataSinkType() == KUidMmfAudioOutput )
+
 			{
 			CMMFAudioOutput* audioOutput = STATIC_CAST(CMMFAudioOutput*,iDataSink);
 			CMMFDevSound& devSound = audioOutput->SoundDevice();
@@ -724,16 +727,22 @@
 #ifdef _DP_DEBUG
 	RDebug::Print(_L("DP::CalculateAudioOutputDuration from %d\n"),iReferenceAudioSamplesPlayed);
 #endif
-
 	CMMFAudioOutput* audioOutput = STATIC_CAST(CMMFAudioOutput*,iDataSink);
 	CMMFDevSound& devSound = audioOutput->SoundDevice();
-	
+
 	TTimeIntervalMicroSeconds devSoundTimePlayed(0);
 	TInt64 timePlayed(0);
 	TInt err = KErrNone;
 	if(iGetTimePlayedSupported)
 		{
-		err= devSound.GetTimePlayed(devSoundTimePlayed);
+		if(iDataSource->DataSourceType() == KUidMmfFormatDecode)
+			{
+			devSoundTimePlayed = ((CMMFFormatDecode*)iDataSource)->PositionL();
+			}
+		else
+			{			
+			err= devSound.GetTimePlayed(devSoundTimePlayed);
+			}
 		if(err == KErrNone)
 			{
 			timePlayed = devSoundTimePlayed.Int64()-iDevSoundRepositionTime.Int64();