Fix issue 2876124.

Allow calls to MediaPlayer::notify() in idle state to signal errors from JNI.

Change-Id: I1515fe69766f0a926b76e15c4971317da2acd6a0
This commit is contained in:
Eric Laurent
2010-08-03 07:49:49 -07:00
parent 23796e3b62
commit 1d53b2a177

View File

@@ -568,7 +568,8 @@ void MediaPlayer::notify(int msg, int ext1, int ext2)
locked = true;
}
if (mPlayer == 0) {
// Allows calls from JNI in idle state to notify errors
if (!(msg == MEDIA_ERROR && mCurrentState == MEDIA_PLAYER_IDLE) && mPlayer == 0) {
LOGV("notify(%d, %d, %d) callback on disconnected mediaplayer", msg, ext1, ext2);
if (locked) mLock.unlock(); // release the lock when done.
return;