aaudio: minor cleanup in clock model
Init mMaxMeasuredLatenessNanos
Use default destructor.
Bug: 137009840
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: Ia9b42e4754047f5e87205c4adbc3329a1b96e74b
diff --git a/media/libaaudio/src/client/IsochronousClockModel.cpp b/media/libaaudio/src/client/IsochronousClockModel.cpp
index bd46d05..f0dcd44 100644
--- a/media/libaaudio/src/client/IsochronousClockModel.cpp
+++ b/media/libaaudio/src/client/IsochronousClockModel.cpp
@@ -47,6 +47,7 @@
, mMarkerNanoTime(0)
, mSampleRate(48000)
, mFramesPerBurst(48)
+ , mBurstPeriodNanos(0) // this will be updated before use
, mMaxMeasuredLatenessNanos(0)
, mLatenessForDriftNanos(kInitialLatenessForDriftNanos)
, mState(STATE_STOPPED)
@@ -57,9 +58,6 @@
}
}
-IsochronousClockModel::~IsochronousClockModel() {
-}
-
void IsochronousClockModel::setPositionAndTime(int64_t framePosition, int64_t nanoTime) {
ALOGV("setPositionAndTime, %lld, %lld", (long long) framePosition, (long long) nanoTime);
mMarkerFramePosition = framePosition;
@@ -186,7 +184,7 @@
// Calculate upper region that will trigger a drift forwards.
mLatenessForDriftNanos = mMaxMeasuredLatenessNanos - (mMaxMeasuredLatenessNanos >> 4);
} else { // decrease
- // If these is an outlier in lateness then mMaxMeasuredLatenessNanos can go high
+ // If this is an outlier in lateness then mMaxMeasuredLatenessNanos can go high
// and stay there. So we slowly reduce mMaxMeasuredLatenessNanos for better
// long term stability. The two opposing forces will keep mMaxMeasuredLatenessNanos
// within a reasonable range.
diff --git a/media/libaaudio/src/client/IsochronousClockModel.h b/media/libaaudio/src/client/IsochronousClockModel.h
index 40f066b..6280013 100644
--- a/media/libaaudio/src/client/IsochronousClockModel.h
+++ b/media/libaaudio/src/client/IsochronousClockModel.h
@@ -35,7 +35,7 @@
public:
IsochronousClockModel();
- virtual ~IsochronousClockModel();
+ virtual ~IsochronousClockModel() = default;
void start(int64_t nanoTime);
void stop(int64_t nanoTime);
@@ -130,6 +130,7 @@
private:
int32_t getLateTimeOffsetNanos() const;
+ void update();
enum clock_model_state_t {
STATE_STOPPED,
@@ -164,7 +165,6 @@
// distribution of timestamps relative to earliest
std::unique_ptr<android::audio_utils::Histogram> mHistogramMicros;
- void update();
};
} /* namespace aaudio */