Skip to content

Commit

Permalink
Add releaseAsync() method
Browse files Browse the repository at this point in the history
  • Loading branch information
protyposis committed Jan 2, 2017
1 parent 7225fca commit 3b1fb2d
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,25 @@ public void release() {
mCurrentState = State.RELEASED;
}

public void releaseAsync() {
if(mCurrentState == State.RELEASING || mCurrentState == State.RELEASED) {
return;
}

mCurrentState = State.RELEASING;

if(mPlaybackThread != null) {
// If there is a playback thread, schedule release...
mPlaybackThread.release();
mPlaybackThread = null;
} else {
// Else, just set the state to released.
mCurrentState = State.RELEASED;
}

stayAwake(false);
}

public void reset() {
stop();
mCurrentState = State.IDLE;
Expand Down

0 comments on commit 3b1fb2d

Please sign in to comment.