audioflinger: fix effect problem during underrun

When an audio track underruns, the input buffer of the
corresponding effect chain (if any) must be cleared, otherwise
audio from previous mixer run will be fed again to the effect process
function.

Bug 6551652.

Change-Id: I5cd02196745f756c85af82d6937e9dc54369b37f
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 51cbae7..19390b1 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -1717,6 +1717,8 @@
         void checkSuspendOnEffectEnabled(const sp<EffectModule>& effect,
                                               bool enabled);
 
+        void clearInputBuffer();
+
         status_t dump(int fd, const Vector<String16>& args);
 
     protected:
@@ -1744,6 +1746,8 @@
         // types or implementations from the suspend/restore mechanism.
         bool isEffectEligibleForSuspend(const effect_descriptor_t& desc);
 
+        void clearInputBuffer_l(sp<ThreadBase> thread);
+
         wp<ThreadBase> mThread;     // parent mixer thread
         Mutex mLock;                // mutex protecting effect list
         Vector< sp<EffectModule> > mEffects; // list of effect modules