Skip to content

Commit

Permalink
Simplify handleTerminator method slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
freyacodes committed May 27, 2024
1 parent 895b7cd commit 99fc4ce
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,11 @@ public boolean provide(MutableAudioFrame targetFrame, long timeout, TimeUnit uni
private void handleTerminator(InternalAudioTrack track) {
synchronized (trackSwitchLock) {
if (activeTrack == track) {
InternalAudioTrack oldTrack = activeTrack;
try {
activeTrack = null;
dispatchEvent(new TrackEndEvent(this, track, track.getActiveExecutor().failedBeforeLoad() ? LOAD_FAILED : FINISHED));
} finally {
oldTrack.stop();
track.stop();
}
}
}
Expand Down

0 comments on commit 99fc4ce

Please sign in to comment.