mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp
branchRCL_3
changeset 21 999b2818a0eb
parent 20 0ac9a5310753
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp	Wed Sep 01 12:23:00 2010 +0100
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp	Tue Sep 14 22:21:33 2010 +0300
@@ -106,8 +106,10 @@
 	CleanupStack::PushL(selfObj);
 
 	CActiveScheduler::Start();
-
-
+	
+	if(selfObj->iCallbackErr != KErrNone)
+	    error = selfObj->iCallbackErr;
+	
 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
 
 	return error;
@@ -136,10 +138,12 @@
 #ifdef _DEBUG
     RDebug::Print (_L ("CThreadPriority::MoscoStateChangeEvent"));
 #endif
-	TInt err = KErrNone;
+	
 
 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
 logger->Log(_L("Before Checking Duaration."));
+iCallbackErr = aErrorCode;
+    
 		TTimeIntervalMicroSeconds aDuration, aRecordTime;
   	    TMMFDurationInfo clipDuration = recorder->Duration(aDuration);
 		logger->Log(_L("Duaration is %d"), aDuration.Int64());
@@ -191,10 +195,17 @@
 
 
 		CActiveScheduler::Stop();
+		return;
 	}
+	 if (aErrorCode != KErrNone)
+        {
+        
+        CActiveScheduler::Stop();
+        return ;
+        }
 
 
-	return;
+
 
 }