Merge "MEDIA_PLAYER_STATE_ERROR is not a bitmask (b/2502881)"

This commit is contained in:
Marco Nelissen
2010-03-10 10:58:23 -08:00
committed by Android (Google) Code Review

View File

@@ -104,7 +104,8 @@ status_t MediaPlayer::setDataSource(const sp<IMediaPlayer>& player)
{ // scope for the lock
Mutex::Autolock _l(mLock);
if ( !( mCurrentState & ( MEDIA_PLAYER_IDLE | MEDIA_PLAYER_STATE_ERROR ) ) ) {
if ( !( (mCurrentState & MEDIA_PLAYER_IDLE) ||
(mCurrentState == MEDIA_PLAYER_STATE_ERROR ) ) ) {
LOGE("setDataSource called in state %d", mCurrentState);
return INVALID_OPERATION;
}