am 406dd5d1: am aadbd80b: Fixed the false drm recognition.

* commit '406dd5d1e48752177753666867403542e1f400ca':
  Fixed the false drm recognition.
This commit is contained in:
James Dong
2011-12-12 15:29:46 -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

@@ -114,6 +114,9 @@ sp<MediaExtractor> MediaExtractor::Create(
ret = new AVIExtractor(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, meta);
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_MPEG2PS)) {