diff options
author | Glenn Kasten <gkasten@google.com> | 2013-08-02 16:14:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-02 16:14:01 +0000 |
commit | f36dbfe3d517e9311be0a4d0fd6658380690e84c (patch) | |
tree | 65768073d7fd288eac6c28f1283589d65fe0cbad /media/libmedia | |
parent | 1a3739169becc850999c3c06db402541119a428c (diff) | |
parent | 82aaf94a5b18939e4d790bbc752031f3070704a3 (diff) | |
download | frameworks_av-f36dbfe3d517e9311be0a4d0fd6658380690e84c.zip frameworks_av-f36dbfe3d517e9311be0a4d0fd6658380690e84c.tar.gz frameworks_av-f36dbfe3d517e9311be0a4d0fd6658380690e84c.tar.bz2 |
Merge "Report underruns for fast tracks also"
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioTrackShared.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp index 3b7616f..e7abb40 100644 --- a/media/libmedia/AudioTrackShared.cpp +++ b/media/libmedia/AudioTrackShared.cpp @@ -661,6 +661,14 @@ bool AudioTrackServerProxy::setStreamEndDone() { return old; } +void AudioTrackServerProxy::tallyUnderrunFrames(uint32_t frameCount) +{ + mCblk->u.mStreaming.mUnderrunFrames += frameCount; + + // FIXME also wake futex so that underrun is noticed more quickly + (void) android_atomic_or(CBLK_UNDERRUN, &mCblk->mFlags); +} + // --------------------------------------------------------------------------- StaticAudioTrackServerProxy::StaticAudioTrackServerProxy(audio_track_cblk_t* cblk, void *buffers, @@ -817,6 +825,17 @@ void StaticAudioTrackServerProxy::releaseBuffer(Buffer* buffer) buffer->mNonContig = 0; } +void StaticAudioTrackServerProxy::tallyUnderrunFrames(uint32_t frameCount) +{ + // Unlike AudioTrackServerProxy::tallyUnderrunFrames() used for streaming tracks, + // we don't have a location to count underrun frames. The underrun frame counter + // only exists in AudioTrackSharedStreaming. Fortunately, underruns are not + // possible for static buffer tracks other than at end of buffer, so this is not a loss. + + // FIXME also wake futex so that underrun is noticed more quickly + (void) android_atomic_or(CBLK_UNDERRUN, &mCblk->mFlags); +} + // --------------------------------------------------------------------------- } // namespace android |