diff options
author | Gloria Wang <gwang@google.com> | 2010-11-22 21:15:07 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-11-22 21:15:07 -0800 |
commit | 4da48ec88338af2df6f9abba850fb4c65918bb82 (patch) | |
tree | e52f023023487df01d9b0050c908924cf7a34010 | |
parent | d93349342a89a25c7a884e8543c6adc048c5f86d (diff) | |
parent | 95dbffb2417a038625df8c790290e610b5f839d9 (diff) | |
download | base-4da48ec88338af2df6f9abba850fb4c65918bb82.tar.gz |
Merge "Notify the playback status to DRM agents before the playback starts"
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 9789e36de068..781e3fc12932 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -526,6 +526,13 @@ status_t AwesomePlayer::play_l() { bool deferredAudioSeek = false; + if (mDecryptHandle != NULL) { + int64_t position; + getPosition(&position); + mDrmManagerClient->setPlaybackStatus(mDecryptHandle, + Playback::START, position / 1000); + } + if (mAudioSource != NULL) { if (mAudioPlayer == NULL) { if (mAudioSink != NULL) { @@ -543,6 +550,11 @@ status_t AwesomePlayer::play_l() { mFlags &= ~(PLAYING | FIRST_FRAME); + if (mDecryptHandle != NULL) { + mDrmManagerClient->setPlaybackStatus(mDecryptHandle, + Playback::STOP, 0); + } + return err; } @@ -582,13 +594,6 @@ status_t AwesomePlayer::play_l() { seekTo_l(0); } - if (mDecryptHandle != NULL) { - int64_t position; - getPosition(&position); - mDrmManagerClient->setPlaybackStatus(mDecryptHandle, - Playback::START, position / 1000); - } - return OK; } |