summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorNicolas Catania <niko@google.com>2010-03-10 10:41:04 -0800
committerNicolas Catania <niko@google.com>2010-03-10 16:17:30 -0800
commit88f3b81d065d4bec6f69a25eda99158e254f55b1 (patch)
tree8e7fc79aa146928b7c33e0102ca4f243e4533904 /media/libmedia
parente182a92ae408f27f46d15de01c8a263cfe6f9246 (diff)
downloadframeworks_base-88f3b81d065d4bec6f69a25eda99158e254f55b1.zip
frameworks_base-88f3b81d065d4bec6f69a25eda99158e254f55b1.tar.gz
frameworks_base-88f3b81d065d4bec6f69a25eda99158e254f55b1.tar.bz2
Allow invoke in all the player states except idle and error.
Previously invoke would work only after prepare but not when the player is in play or pause state (for instance). This new change just check that the player has been initialized and is not in the error state. Bug:2488931 Change-Id: I7a69d1b6e3eec1e5dbdf7378ff2085329062595a
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/mediaplayer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index f623295..9fc06cd 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -159,8 +159,10 @@ status_t MediaPlayer::setDataSource(int fd, int64_t offset, int64_t length)
status_t MediaPlayer::invoke(const Parcel& request, Parcel *reply)
{
Mutex::Autolock _l(mLock);
- if ((mPlayer != NULL) && ( mCurrentState & MEDIA_PLAYER_INITIALIZED ))
- {
+ const bool hasBeenInitialized =
+ (mCurrentState != MEDIA_PLAYER_STATE_ERROR) &&
+ ((mCurrentState & MEDIA_PLAYER_IDLE) != MEDIA_PLAYER_STATE_IDLE);
+ if ((mPlayer != NULL) && hasBeenInitialized) {
LOGV("invoke %d", request.dataSize());
return mPlayer->invoke(request, reply);
}