From 686589f91b92cdcd3a7b85b49a3fe7d09913e66c Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Tue, 23 Sep 2014 10:55:35 -0700 Subject: [PATCH] NuPlayer: change assert to conditional check. Bug: 17491050 Change-Id: I657866c5342c227d57617eb89955897171eb5976 --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 26 +++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index b589909346..2ea12ae8a3 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -984,17 +984,31 @@ void NuPlayer::onMessageReceived(const sp &msg) { case kWhatPause: { - CHECK(mRenderer != NULL); - mSource->pause(); - mRenderer->pause(); + if (mSource != NULL) { + mSource->pause(); + } else { + ALOGW("pause called when source is gone or not set"); + } + if (mRenderer != NULL) { + mRenderer->pause(); + } else { + ALOGW("pause called when renderer is gone or not set"); + } break; } case kWhatResume: { - CHECK(mRenderer != NULL); - mSource->resume(); - mRenderer->resume(); + if (mSource != NULL) { + mSource->resume(); + } else { + ALOGW("resume called when source is gone or not set"); + } + if (mRenderer != NULL) { + mRenderer->resume(); + } else { + ALOGW("resume called when renderer is gone or not set"); + } break; } -- 2.11.0