Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef0ade40 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "aaudio: minor cleanup in clock model" into rvc-dev

parents 4023d73e 9e1f44b7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ IsochronousClockModel::IsochronousClockModel()
        , 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()
    }
}

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 @@ void IsochronousClockModel::processTimestamp(int64_t framePosition, int64_t nano
            // 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.
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class IsochronousClockModel {

public:
    IsochronousClockModel();
    virtual ~IsochronousClockModel();
    virtual ~IsochronousClockModel() = default;

    void start(int64_t nanoTime);
    void stop(int64_t nanoTime);
@@ -130,6 +130,7 @@ public:
private:

    int32_t getLateTimeOffsetNanos() const;
    void update();

    enum clock_model_state_t {
        STATE_STOPPED,
@@ -164,7 +165,6 @@ private:
    // distribution of timestamps relative to earliest
    std::unique_ptr<android::audio_utils::Histogram>   mHistogramMicros;

    void update();
};

} /* namespace aaudio */