Skip to content

Commit 4da48ec

Browse files
Gloria WangAndroid Code Review
authored andcommitted
Merge "Notify the playback status to DRM agents before the playback starts"
2 parents d933493 + 95dbffb commit 4da48ec

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

media/libstagefright/AwesomePlayer.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ status_t AwesomePlayer::play_l() {
526526

527527
bool deferredAudioSeek = false;
528528

529+
if (mDecryptHandle != NULL) {
530+
int64_t position;
531+
getPosition(&position);
532+
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
533+
Playback::START, position / 1000);
534+
}
535+
529536
if (mAudioSource != NULL) {
530537
if (mAudioPlayer == NULL) {
531538
if (mAudioSink != NULL) {
@@ -543,6 +550,11 @@ status_t AwesomePlayer::play_l() {
543550

544551
mFlags &= ~(PLAYING | FIRST_FRAME);
545552

553+
if (mDecryptHandle != NULL) {
554+
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
555+
Playback::STOP, 0);
556+
}
557+
546558
return err;
547559
}
548560

@@ -582,13 +594,6 @@ status_t AwesomePlayer::play_l() {
582594
seekTo_l(0);
583595
}
584596

585-
if (mDecryptHandle != NULL) {
586-
int64_t position;
587-
getPosition(&position);
588-
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
589-
Playback::START, position / 1000);
590-
}
591-
592597
return OK;
593598
}
594599

0 commit comments

Comments
 (0)