@@ -288,14 +288,9 @@ status_t AwesomePlayer::setDataSource_l(
288288 }
289289
290290 dataSource->getDrmInfo (&mDecryptHandle , &mDrmManagerClient );
291- if (mDecryptHandle != NULL ) {
292- if (RightsStatus::RIGHTS_VALID == mDecryptHandle ->status ) {
293- if (DecryptApiType::CONTAINER_BASED == mDecryptHandle ->decryptApiType ) {
294- mDrmManagerClient ->consumeRights (mDecryptHandle , Action::PLAY, true );
295- }
296- } else {
297- notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
298- }
291+ if (mDecryptHandle != NULL
292+ && RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
293+ notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
299294 }
300295
301296 return setDataSource_l (extractor);
@@ -328,11 +323,6 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
328323 }
329324
330325 mExtractorFlags = extractor->flags ();
331- if (mDecryptHandle != NULL ) {
332- if (DecryptApiType::ELEMENTARY_STREAM_BASED == mDecryptHandle ->decryptApiType ) {
333- mDrmManagerClient ->consumeRights (mDecryptHandle , Action::PLAY, true );
334- }
335- }
336326
337327 return OK;
338328}
@@ -346,8 +336,6 @@ void AwesomePlayer::reset_l() {
346336 if (mDecryptHandle != NULL ) {
347337 mDrmManagerClient ->setPlaybackStatus (mDecryptHandle ,
348338 Playback::STOP, 0 );
349- mDrmManagerClient ->consumeRights (mDecryptHandle ,
350- Action::PLAY, false );
351339 mDecryptHandle = NULL ;
352340 mDrmManagerClient = NULL ;
353341 }
@@ -1190,14 +1178,9 @@ status_t AwesomePlayer::finishSetDataSource_l() {
11901178 }
11911179
11921180 dataSource->getDrmInfo (&mDecryptHandle , &mDrmManagerClient );
1193- if (mDecryptHandle != NULL ) {
1194- if (RightsStatus::RIGHTS_VALID == mDecryptHandle ->status ) {
1195- if (DecryptApiType::CONTAINER_BASED == mDecryptHandle ->decryptApiType ) {
1196- mDrmManagerClient ->consumeRights (mDecryptHandle , Action::PLAY, true );
1197- }
1198- } else {
1199- notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
1200- }
1181+ if (mDecryptHandle != NULL
1182+ && RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
1183+ notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
12011184 }
12021185
12031186 if (dataSource->flags () & DataSource::kWantsPrefetching ) {
0 commit comments