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

Commit d2d7a135 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

DO NOT MERGE ANYWHERE: Partial Revert of ag/27467076 for Pixel

Roll back the aspect of ag/27467076 ("libaudiohal@aidl:
Align position reporting with HIDL") regarding compressed
offload streams.

The revert is intended for 24D1-release only, it addresses
a problem specific to the Pixel audio HAL. The Pixel team is
working on a long-term solution for the 24Q3 branch.

Reason for revert: b/343334029

Bug: 343334029
Test: repro steps from the bug
Test: atest CtsMediaAudioTestCases
Change-Id: Icef4429260b0b0360dd7191e76c0d60418b48d7d
parent 0be9192f
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -686,11 +686,12 @@ status_t StreamOutHalAidl::getRenderPosition(uint64_t *dspFrames) {
    int64_t mostRecentResetPoint;
    int64_t mostRecentResetPoint;
    if (!mContext.isAsynchronous() && audio_has_proportional_frames(mConfig.format)) {
    if (!mContext.isAsynchronous() && audio_has_proportional_frames(mConfig.format)) {
        mostRecentResetPoint = statePositions.framesAtStandby;
        mostRecentResetPoint = statePositions.framesAtStandby;
        *dspFrames = aidlFrames <= mostRecentResetPoint ? 0 : aidlFrames - mostRecentResetPoint;
    } else {
    } else {
        mostRecentResetPoint =
        // Pixel HAL of 24D1 resets the position on flush/drain for compressed offload streams,
                std::max(statePositions.framesAtStandby, statePositions.framesAtFlushOrDrain);
        // thus is does not have to be reset here.
        *dspFrames = aidlFrames;
    }
    }
    *dspFrames = aidlFrames <= mostRecentResetPoint ? 0 : aidlFrames - mostRecentResetPoint;
    return OK;
    return OK;
}
}