Skip to content

Commit aadbd80

Browse files
author
James Dong
committed
Fixed the false drm recognition.
Change-Id: If0198e52ff7bbd7422f219f55a37aae97f7d74f1 related-to-bug: 5732033
1 parent be5f49f commit aadbd80

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

media/libstagefright/AwesomePlayer.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

media/libstagefright/MediaExtractor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ sp<MediaExtractor> MediaExtractor::Create(
111111
ret = new MPEG2TSExtractor(source);
112112
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_WVM)) {
113113
ret = new WVMExtractor(source);
114+
if (ret != NULL) {
115+
isDrm = true;
116+
}
114117
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC_ADTS)) {
115118
ret = new AACExtractor(source);
116119
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_MPEG2PS)) {

0 commit comments

Comments
 (0)