summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-04-24 09:52:31 -0700
committerChong Zhang <chz@google.com>2015-04-24 09:53:56 -0700
commit45c765da4d67088ea7ce0fab438300682c3914f0 (patch)
treee50d553eabad4674e6f9b03df62851b92f0e1399 /media
parent04f07fd61022dac46ddda9c815d65bc3d3278b84 (diff)
downloadframeworks_av-45c765da4d67088ea7ce0fab438300682c3914f0.zip
frameworks_av-45c765da4d67088ea7ce0fab438300682c3914f0.tar.gz
frameworks_av-45c765da4d67088ea7ce0fab438300682c3914f0.tar.bz2
MediaCodec: ignore error when linkToDeath to batterystats
bug: 20071299 Change-Id: I932b40e46312db467fe88f8ff6cea028b63785cd
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);
}