am aadbd80b: Fixed the false drm recognition.

* commit 'aadbd80b307c817698ce5110ff8e002804d1b230':
  Fixed the false drm recognition.
This commit is contained in:
James Dong
2011-12-09 00:17:56 -08:00
committed by Android Git Automerger
2 changed files with 17 additions and 10 deletions

View File

@@ -335,11 +335,13 @@ status_t AwesomePlayer::setDataSource_l(
return UNKNOWN_ERROR;
}
dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
if (mDecryptHandle != NULL) {
CHECK(mDrmManagerClient);
if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
if (extractor->getDrmFlag()) {
dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
if (mDecryptHandle != NULL) {
CHECK(mDrmManagerClient);
if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
}
}
}
@@ -2113,12 +2115,14 @@ status_t AwesomePlayer::finishSetDataSource_l() {
}
}
dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
if (extractor->getDrmFlag()) {
dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
if (mDecryptHandle != NULL) {
CHECK(mDrmManagerClient);
if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
if (mDecryptHandle != NULL) {
CHECK(mDrmManagerClient);
if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
}
}
}

View File

@@ -111,6 +111,9 @@ sp<MediaExtractor> MediaExtractor::Create(
ret = new MPEG2TSExtractor(source);
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_WVM)) {
ret = new WVMExtractor(source);
if (ret != NULL) {
isDrm = true;
}
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC_ADTS)) {
ret = new AACExtractor(source);
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_MPEG2PS)) {