@@ -335,11 +335,13 @@ status_t AwesomePlayer::setDataSource_l(
335335 return UNKNOWN_ERROR;
336336 }
337337
338- dataSource->getDrmInfo (mDecryptHandle , &mDrmManagerClient );
339- if (mDecryptHandle != NULL ) {
340- CHECK (mDrmManagerClient );
341- if (RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
342- notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
338+ if (extractor->getDrmFlag ()) {
339+ dataSource->getDrmInfo (mDecryptHandle , &mDrmManagerClient );
340+ if (mDecryptHandle != NULL ) {
341+ CHECK (mDrmManagerClient );
342+ if (RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
343+ notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
344+ }
343345 }
344346 }
345347
@@ -2113,12 +2115,14 @@ status_t AwesomePlayer::finishSetDataSource_l() {
21132115 }
21142116 }
21152117
2116- dataSource->getDrmInfo (mDecryptHandle , &mDrmManagerClient );
2118+ if (extractor->getDrmFlag ()) {
2119+ dataSource->getDrmInfo (mDecryptHandle , &mDrmManagerClient );
21172120
2118- if (mDecryptHandle != NULL ) {
2119- CHECK (mDrmManagerClient );
2120- if (RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
2121- notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
2121+ if (mDecryptHandle != NULL ) {
2122+ CHECK (mDrmManagerClient );
2123+ if (RightsStatus::RIGHTS_VALID != mDecryptHandle ->status ) {
2124+ notifyListener_l (MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
2125+ }
21222126 }
21232127 }
21242128
0 commit comments