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

Commit ca37babb authored by Vadim Caen's avatar Vadim Caen Committed by Android (Google) Code Review
Browse files

Merge "Fix timestamp not increasing on repeated frame" into main

parents 19d61365 5f900c5d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -557,8 +557,9 @@ std::chrono::nanoseconds VirtualCameraRenderThread::throttleRendering(
std::chrono::nanoseconds VirtualCameraRenderThread::getSurfaceTimestamp(
    std::chrono::nanoseconds timeSinceLastFrame) {
  std::chrono::nanoseconds surfaceTimestamp = mEglSurfaceTexture->getTimestamp();
  if (surfaceTimestamp.count() < 0) {
  uint64_t lastSurfaceTimestamp = mLastSurfaceTimestampNanoseconds.load();
  if (surfaceTimestamp.count() < 0 ||
      surfaceTimestamp.count() == lastSurfaceTimestamp) {
    if (lastSurfaceTimestamp > 0) {
      // The timestamps were provided by the producer but we are
      // repeating the last frame, so we increase the previous timestamp by