Skip to content

Commit

Permalink
fix opengl freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Sep 13, 2023
1 parent 20a3900 commit 96c69c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Expand Up @@ -162,7 +162,8 @@ class GlStreamInterface(private val context: Context) : Runnable, OnFrameAvailab
}
}
synchronized(sync) {
sync.wait(fpsLimiter.sleepTime)
val sleep = fpsLimiter.sleepTime
if (sleep > 0) sync.wait(sleep)
}
}
} catch (ignore: InterruptedException) {
Expand Down
Expand Up @@ -134,7 +134,8 @@ public void run() {
}
}
synchronized (sync) {
sync.wait(fpsLimiter.getSleepTime());
long sleep = fpsLimiter.getSleepTime();
if (sleep > 0) sync.wait(sleep);
}
}
} catch (InterruptedException ignore) {
Expand Down
Expand Up @@ -315,7 +315,8 @@ public void run() {
}
}
synchronized (sync) {
sync.wait(fpsLimiter.getSleepTime());
long sleep = fpsLimiter.getSleepTime();
if (sleep > 0) sync.wait(sleep);
}
}
} catch (InterruptedException ignore) {
Expand Down
3 changes: 2 additions & 1 deletion library/src/main/java/com/pedro/library/view/OpenGlView.java
Expand Up @@ -215,7 +215,8 @@ public void run() {
}
}
synchronized (sync) {
sync.wait(fpsLimiter.getSleepTime());
long sleep = fpsLimiter.getSleepTime();
if (sleep > 0) sync.wait(sleep);
}
}
} catch (InterruptedException ignore) {
Expand Down

0 comments on commit 96c69c0

Please sign in to comment.