mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp
changeset 47 c2e43643db4c
parent 0 71ca22bcf22a
child 46 0ac9a5310753
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp	Wed Aug 18 10:17:22 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/ThreadPriority.cpp	Thu Sep 02 20:58:01 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;
+
 
 }