am 3e18dfab: am 4da48ec8: Merge "Notify the playback status to DRM agents before the playback starts"
* commit '3e18dfab3417e139c7ec3896cea9e303fdc8fa63':
Notify the playback status to DRM agents before the playback starts
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index fe5162e..ec58919 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -707,6 +707,13 @@
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) {
@@ -724,6 +731,11 @@
mFlags &= ~(PLAYING | FIRST_FRAME);
+ if (mDecryptHandle != NULL) {
+ mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
+ Playback::STOP, 0);
+ }
+
return err;
}
@@ -760,13 +772,6 @@
seekTo_l(0);
}
- if (mDecryptHandle != NULL) {
- int64_t position;
- getPosition(&position);
- mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
- Playback::START, position / 1000);
- }
-
return OK;
}