Skip to content

Commit

Permalink
Tidy up audio play
Browse files Browse the repository at this point in the history
It doesn't seem to matter that audio.play() gets called each update. If there's much overhead to doing so, I'll change it.
  • Loading branch information
Frosty-J authored and SimonIT committed Mar 30, 2024
1 parent 4492f8b commit 0f90d38
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ private int readFileContents (ByteBuffer buffer) {
@Override
public boolean update () {
if (decoder != null && (!paused || isFirstFrame) && playing) {
if (!paused && currentVideoTime == 0) {
// Since startTime is 0, this means that we should now display the first frame of the video, and set the
// time.
if (audio != null) {
audio.play();
}
if (!paused && audio != null) {
audio.play();
}

boolean newFrame = false;
Expand Down

0 comments on commit 0f90d38

Please sign in to comment.