From 45c765da4d67088ea7ce0fab438300682c3914f0 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Fri, 24 Apr 2015 09:52:31 -0700 Subject: MediaCodec: ignore error when linkToDeath to batterystats bug: 20071299 Change-Id: I932b40e46312db467fe88f8ff6cea028b63785cd --- media/libstagefright/MediaCodec.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'media') 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 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 batteryService = getBatteryService_l(); + + mVideoRefCount--; if (mVideoRefCount == 0 && batteryService != NULL) { batteryService->noteStopVideo(AID_MEDIA); } @@ -202,8 +198,9 @@ void MediaCodec::BatteryNotifier::noteStopAudio() { return; } - mAudioRefCount--; sp batteryService = getBatteryService_l(); + + mAudioRefCount--; if (mAudioRefCount == 0 && batteryService != NULL) { batteryService->noteStopAudio(AID_MEDIA); } -- cgit v1.1