mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp
branchRCL_3
changeset 31 a12246c97fcc
parent 28 56b11cf8addb
child 50 26a1709b9fec
equal deleted inserted replaced
28:56b11cf8addb 31:a12246c97fcc
   433             }
   433             }
   434         case EPbApplyEffect:
   434         case EPbApplyEffect:
   435             {
   435             {
   436             // Re-init audio effects
   436             // Re-init audio effects
   437             MPX_DEBUG1("CMPXLocalAudioPlayback::CommandL EPbApplyEffect");
   437             MPX_DEBUG1("CMPXLocalAudioPlayback::CommandL EPbApplyEffect");
   438             iAudioEffects->DestroyAudioEffect();
       
   439             if( ( aData == KAudioEffectsID || aData == KEqualizerID ) &&
   438             if( ( aData == KAudioEffectsID || aData == KEqualizerID ) &&
   440                 ( EStateInitialised == iState ) )
   439                 ( EStateInitialised == iState ) )
   441                 {
   440                 {
       
   441                 // Here we rely on CreateAudioEffectsL() to be safe to be called 
       
   442                 // in order to just set values again     
   442                 TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
   443                 TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
   443                 if(err)
   444                 if(err)
   444                     {
   445                     {
   445                     MPX_DEBUG2("EPbApplyEffect err = %d", err);
   446                     MPX_DEBUG2("EPbApplyEffect err = %d", err);
       
   447                     // Sometimes we get KErrAccessDenied, then destroying effects
       
   448                     // and setting them again should help. This is a work-around, 
       
   449                     // and would be good to be fixed more properly.   
       
   450                     iAudioEffects->DestroyAudioEffect(); 
   446                     TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
   451                     TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
   447                     if(err)
   452                     if(err)
   448                         {
   453                         {
   449                         MPX_DEBUG2("EPbApplyEffect again err = %d", err);
   454                         MPX_DEBUG2("EPbApplyEffect again err = %d", err);
   450                         }
   455                         }