Fix for Issue #208: Media.release() accidentally makes a call to the Media error callback

This commit is contained in:
macdonst 2011-08-26 00:14:50 +08:00 committed by brianleroux
parent 4a38f160fb
commit 9083e921d9

View File

@ -86,7 +86,10 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
// Stop any play or record
if (this.mPlayer != null) {
this.stopPlaying();
if ((this.state == MEDIA_RUNNING) || (this.state == MEDIA_PAUSED)) {
this.mPlayer.stop();
this.setState(MEDIA_STOPPED);
}
this.mPlayer.release();
this.mPlayer = null;
}