diff options
author | Phil Burk <philburk@google.com> | 2015-06-09 16:53:44 -0700 |
---|---|---|
committer | Phil Burk <philburk@google.com> | 2015-06-11 10:37:21 -0700 |
commit | 43b4dcc660e6da96285e4672ae371070ab845401 (patch) | |
tree | f03f4f3817afd22eb759962cde571029f312e1b6 /services/audioflinger/Threads.h | |
parent | afd492436efc7f66b958da14659b52232efa5910 (diff) | |
download | frameworks_av-43b4dcc660e6da96285e4672ae371070ab845401.zip frameworks_av-43b4dcc660e6da96285e4672ae371070ab845401.tar.gz frameworks_av-43b4dcc660e6da96285e4672ae371070ab845401.tar.bz2 |
AudioFlinger: flush stream when switching tracks
For direct threads, when recycling a stream, perform a flush so
that the frame position is reset.
Bug: 21145353
Change-Id: I08611cd64bb249a9659c44f9e4c47e7455f4838f
Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r-- | services/audioflinger/Threads.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 7b4fb14..4ebe615 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -941,6 +941,8 @@ protected: virtual void threadLoop_exit(); virtual bool shouldStandby_l(); + virtual void onAddNewTrack_l(); + // volumes last sent to audio HAL with stream->set_volume() float mLeftVolFloat; float mRightVolFloat; @@ -952,6 +954,9 @@ protected: // prepareTracks_l() tells threadLoop_mix() the name of the single active track sp<Track> mActiveTrack; + + wp<Track> mPreviousTrack; // used to detect track switch + public: virtual bool hasFastMixer() const { return false; } }; @@ -971,12 +976,10 @@ protected: virtual bool waitingAsyncCallback(); virtual bool waitingAsyncCallback_l(); - virtual void onAddNewTrack_l(); private: size_t mPausedWriteLength; // length in bytes of write interrupted by pause size_t mPausedBytesRemaining; // bytes still waiting in mixbuffer after resume - wp<Track> mPreviousTrack; // used to detect track switch }; class AsyncCallbackThread : public Thread { |