mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp
branchRCL_3
changeset 31 a12246c97fcc
parent 28 56b11cf8addb
child 50 26a1709b9fec
--- a/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp	Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp	Wed Jun 09 09:38:28 2010 +0300
@@ -435,14 +435,19 @@
             {
             // Re-init audio effects
             MPX_DEBUG1("CMPXLocalAudioPlayback::CommandL EPbApplyEffect");
-            iAudioEffects->DestroyAudioEffect();
             if( ( aData == KAudioEffectsID || aData == KEqualizerID ) &&
                 ( EStateInitialised == iState ) )
                 {
+                // Here we rely on CreateAudioEffectsL() to be safe to be called 
+                // in order to just set values again     
                 TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
                 if(err)
                     {
                     MPX_DEBUG2("EPbApplyEffect err = %d", err);
+                    // Sometimes we get KErrAccessDenied, then destroying effects
+                    // and setting them again should help. This is a work-around, 
+                    // and would be good to be fixed more properly.   
+                    iAudioEffects->DestroyAudioEffect(); 
                     TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
                     if(err)
                         {