summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-29 07:07:30 -0800
committerGlenn Kasten <gkasten@google.com>2012-02-29 11:36:54 -0800
commitc455fe9727d361076b7cead3efdac2d32a1a1d6d (patch)
tree10f603fdaeb746bdb00bc43e567751109783db0a /services
parent8b20e9272d2f8d5160494de3212d66a399b3637f (diff)
downloadframeworks_av-c455fe9727d361076b7cead3efdac2d32a1a1d6d.zip
frameworks_av-c455fe9727d361076b7cead3efdac2d32a1a1d6d.tar.gz
frameworks_av-c455fe9727d361076b7cead3efdac2d32a1a1d6d.tar.bz2
mSuspend comments and usage
Emphasize that playbackthread::mSuspend is a counter, not a bool Change-Id: I7188e56814e1c54dbc65e560f3627f138257d644
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp16
-rw-r--r--services/audioflinger/AudioFlinger.h6
2 files changed, 11 insertions, 11 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 36df2c0..aea002b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2050,9 +2050,9 @@ bool AudioFlinger::MixerThread::threadLoop()
// put audio hardware into standby after short delay
if (CC_UNLIKELY((!activeTracks.size() && systemTime() > standbyTime) ||
- mSuspended)) {
+ mSuspended > 0)) {
if (!mStandby) {
- ALOGV("Audio hardware entering standby, mixer %p, mSuspended %d", this, mSuspended);
+ ALOGV("Audio hardware entering standby, mixer %p, suspend count %u", this, mSuspended);
mOutput->stream->common.standby(&mOutput->stream->common);
mStandby = true;
mBytesWritten = 0;
@@ -2143,7 +2143,7 @@ bool AudioFlinger::MixerThread::threadLoop()
// TODO add standby time extension fct of effect tail
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
@@ -2778,9 +2778,9 @@ bool AudioFlinger::DirectOutputThread::threadLoop()
// put audio hardware into standby after short delay
if (CC_UNLIKELY((!mActiveTracks.size() && systemTime() > standbyTime) ||
- mSuspended)) {
+ mSuspended > 0)) {
if (!mStandby) {
- ALOGV("Audio hardware entering standby, mixer %p, mSuspended %d", this, mSuspended);
+ ALOGV("Audio hardware entering standby, mixer %p, suspend count %u", this, mSuspended);
mOutput->stream->common.standby(&mOutput->stream->common);
mStandby = true;
mBytesWritten = 0;
@@ -2976,7 +2976,7 @@ bool AudioFlinger::DirectOutputThread::threadLoop()
}
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
@@ -3192,7 +3192,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop()
// put audio hardware into standby after short delay
if (CC_UNLIKELY((!activeTracks.size() && systemTime() > standbyTime) ||
- mSuspended)) {
+ mSuspended > 0)) {
if (!mStandby) {
// DuplicatingThread implements standby by stopping all tracks
for (size_t i = 0; i < outputTracks.size(); i++) {
@@ -3264,7 +3264,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop()
}
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index e908d3f..dbd2597 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -821,8 +821,8 @@ private:
virtual audio_stream_t* stream();
void suspend() { mSuspended++; }
- void restore() { if (mSuspended) mSuspended--; }
- bool isSuspended() const { return (mSuspended != 0); }
+ void restore() { if (mSuspended > 0) mSuspended--; }
+ bool isSuspended() const { return (mSuspended > 0); }
virtual String8 getParameters(const String8& keys);
virtual void audioConfigChanged_l(int event, int param = 0);
virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
@@ -843,7 +843,7 @@ private:
protected:
int16_t* mMixBuffer;
- int mSuspended;
+ uint32_t mSuspended; // suspend count, > 0 means suspended
int mBytesWritten;
private:
// mMasterMute is in both PlaybackThread and in AudioFlinger. When a