Loading services/audioflinger/Threads.h +2 −1 Original line number Diff line number Diff line Loading @@ -1172,7 +1172,7 @@ protected: volatile int32_t mSuspended; int64_t mBytesWritten; int64_t mFramesWritten; // not reset on standby std::atomic<int64_t> mFramesWritten; // not reset on standby int64_t mLastFramesWritten = -1; // track changes in timestamp // server frames written. int64_t mSuspendedFrames; // not reset on standby Loading Loading @@ -1386,6 +1386,7 @@ public: virtual bool hasFastMixer() const = 0; virtual FastTrackUnderruns getFastTrackUnderruns(size_t fastIndex __unused) const { FastTrackUnderruns dummy; return dummy; } const std::atomic<int64_t>& framesWritten() const { return mFramesWritten; } protected: // accessed by both binder threads and within threadLoop(), lock on mutex needed Loading services/audioflinger/Tracks.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -1094,12 +1094,22 @@ status_t AudioFlinger::PlaybackThread::Track::start(AudioSystem::sync_event_t ev __func__, mId, (int)mThreadIoHandle); } // states to reset position info for non-offloaded/direct tracks if (!isOffloaded() && !isDirect() PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); // states to reset position info for pcm tracks if (audio_is_linear_pcm(mFormat) && (state == IDLE || state == STOPPED || state == FLUSHED)) { mFrameMap.reset(); if (!isFastTrack() && (isDirect() || isOffloaded())) { // Start point of track -> sink frame map. If the HAL returns a // frame position smaller than the first written frame in // updateTrackFrameInfo, the timestamp can be interpolated // instead of using a larger value. mFrameMap.push(mAudioTrackServerProxy->framesReleased(), playbackThread->framesWritten()); } } PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); if (isFastTrack()) { // refresh fast track underruns on start because that field is never cleared // by the fast mixer; furthermore, the same track can be recycled, i.e. start Loading Loading
services/audioflinger/Threads.h +2 −1 Original line number Diff line number Diff line Loading @@ -1172,7 +1172,7 @@ protected: volatile int32_t mSuspended; int64_t mBytesWritten; int64_t mFramesWritten; // not reset on standby std::atomic<int64_t> mFramesWritten; // not reset on standby int64_t mLastFramesWritten = -1; // track changes in timestamp // server frames written. int64_t mSuspendedFrames; // not reset on standby Loading Loading @@ -1386,6 +1386,7 @@ public: virtual bool hasFastMixer() const = 0; virtual FastTrackUnderruns getFastTrackUnderruns(size_t fastIndex __unused) const { FastTrackUnderruns dummy; return dummy; } const std::atomic<int64_t>& framesWritten() const { return mFramesWritten; } protected: // accessed by both binder threads and within threadLoop(), lock on mutex needed Loading
services/audioflinger/Tracks.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -1094,12 +1094,22 @@ status_t AudioFlinger::PlaybackThread::Track::start(AudioSystem::sync_event_t ev __func__, mId, (int)mThreadIoHandle); } // states to reset position info for non-offloaded/direct tracks if (!isOffloaded() && !isDirect() PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); // states to reset position info for pcm tracks if (audio_is_linear_pcm(mFormat) && (state == IDLE || state == STOPPED || state == FLUSHED)) { mFrameMap.reset(); if (!isFastTrack() && (isDirect() || isOffloaded())) { // Start point of track -> sink frame map. If the HAL returns a // frame position smaller than the first written frame in // updateTrackFrameInfo, the timestamp can be interpolated // instead of using a larger value. mFrameMap.push(mAudioTrackServerProxy->framesReleased(), playbackThread->framesWritten()); } } PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); if (isFastTrack()) { // refresh fast track underruns on start because that field is never cleared // by the fast mixer; furthermore, the same track can be recycled, i.e. start Loading