// 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;
// TODO add standby time extension fct of effect tail
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
// 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;
}
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
// 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++) {
}
}
- if (mSuspended) {
+ if (mSuspended > 0) {
sleepTime = suspendSleepTimeUs();
}
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);
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