summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-04-24 17:45:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-24 17:45:26 +0000
commit11f88677e9a9405d2b5d7f7bf9b6eec035b6331d (patch)
treed9e0dd64d6b604dd4a805ee4054c143c017ad565 /media
parentbb6635d0aa35d6d31ec7de7c0d957720983fdc55 (diff)
parent45c765da4d67088ea7ce0fab438300682c3914f0 (diff)
downloadframeworks_av-11f88677e9a9405d2b5d7f7bf9b6eec035b6331d.zip
frameworks_av-11f88677e9a9405d2b5d7f7bf9b6eec035b6331d.tar.gz
frameworks_av-11f88677e9a9405d2b5d7f7bf9b6eec035b6331d.tar.bz2
Merge "MediaCodec: ignore error when linkToDeath to batterystats"
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MediaCodec.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 93864e4..96b22c0 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -139,12 +139,7 @@ sp<IBatteryStats> MediaCodec::BatteryNotifier::getBatteryService_l() {
return NULL;
}
mDeathNotifier = new DeathNotifier();
- if (IInterface::asBinder(mBatteryStatService)->
- linkToDeath(mDeathNotifier) != OK) {
- mBatteryStatService.clear();
- mDeathNotifier.clear();
- return NULL;
- }
+ IInterface::asBinder(mBatteryStatService)->linkToDeath(mDeathNotifier);
// notify start now if media already started
if (mVideoRefCount > 0) {
mBatteryStatService->noteStartVideo(AID_MEDIA);
@@ -179,8 +174,9 @@ void MediaCodec::BatteryNotifier::noteStopVideo() {
return;
}
- mVideoRefCount--;
sp<IBatteryStats> batteryService = getBatteryService_l();
+
+ mVideoRefCount--;
if (mVideoRefCount == 0 && batteryService != NULL) {
batteryService->noteStopVideo(AID_MEDIA);
}
@@ -202,8 +198,9 @@ void MediaCodec::BatteryNotifier::noteStopAudio() {
return;
}
- mAudioRefCount--;
sp<IBatteryStats> batteryService = getBatteryService_l();
+
+ mAudioRefCount--;
if (mAudioRefCount == 0 && batteryService != NULL) {
batteryService->noteStopAudio(AID_MEDIA);
}