Merge "check error on setMediaCas" into rvc-dev am: c2dca7092a am: 380e8a6a3b am: 55afaa3b7b
Change-Id: I1966dc104b135d93f88e5d0af08b15e4529c7ab6
diff --git a/media/libstagefright/NuMediaExtractor.cpp b/media/libstagefright/NuMediaExtractor.cpp
index 9fe09fa..050d7c2 100644
--- a/media/libstagefright/NuMediaExtractor.cpp
+++ b/media/libstagefright/NuMediaExtractor.cpp
@@ -94,11 +94,16 @@
return ERROR_UNSUPPORTED;
}
+ status_t err = OK;
if (!mCasToken.empty()) {
- mImpl->setMediaCas(mCasToken);
+ err = mImpl->setMediaCas(mCasToken);
+ if (err != OK) {
+ ALOGE("%s: failed to setMediaCas (%d)", __FUNCTION__, err);
+ return err;
+ }
}
- status_t err = updateDurationAndBitrate();
+ err = updateDurationAndBitrate();
if (err == OK) {
mDataSource = dataSource;
}
@@ -131,7 +136,11 @@
}
if (!mCasToken.empty()) {
- mImpl->setMediaCas(mCasToken);
+ err = mImpl->setMediaCas(mCasToken);
+ if (err != OK) {
+ ALOGE("%s: failed to setMediaCas (%d)", __FUNCTION__, err);
+ return err;
+ }
}
err = updateDurationAndBitrate();
@@ -161,7 +170,11 @@
}
if (!mCasToken.empty()) {
- mImpl->setMediaCas(mCasToken);
+ err = mImpl->setMediaCas(mCasToken);
+ if (err != OK) {
+ ALOGE("%s: failed to setMediaCas (%d)", __FUNCTION__, err);
+ return err;
+ }
}
err = updateDurationAndBitrate();
@@ -195,8 +208,12 @@
mCasToken = casToken;
if (mImpl != NULL) {
- mImpl->setMediaCas(casToken);
- status_t err = updateDurationAndBitrate();
+ status_t err = mImpl->setMediaCas(casToken);
+ if (err != OK) {
+ ALOGE("%s: failed to setMediaCas (%d)", __FUNCTION__, err);
+ return err;
+ }
+ err = updateDurationAndBitrate();
if (err != OK) {
return err;
}