OSDN Git Service

Add a missing NULL check.
authorJohn Grossman <johngro@google.com>
Fri, 24 Aug 2012 00:47:31 +0000 (17:47 -0700)
committerJohn Grossman <johngro@google.com>
Fri, 24 Aug 2012 00:47:31 +0000 (17:47 -0700)
Don't crash if its time to start the next media player in a media
player chain, but the current player's client has a NULL mAudioOutput,
as is the case when the low level player implements
MediaPlayerHWInterface.

Change-Id: If555da3a46960cbee91ff26e5b1fd05e52c8ef28

media/libmediaplayerservice/MediaPlayerService.cpp

index 8620856..58e4723 100644 (file)
@@ -1046,7 +1046,8 @@ void MediaPlayerService::Client::notify(
     {
         Mutex::Autolock l(client->mLock);
         if (msg == MEDIA_PLAYBACK_COMPLETE && client->mNextClient != NULL) {
-            client->mAudioOutput->switchToNextOutput();
+            if (client->mAudioOutput != NULL)
+                client->mAudioOutput->switchToNextOutput();
             client->mNextClient->start();
             client->mNextClient->mClient->notify(MEDIA_INFO, MEDIA_INFO_STARTED_AS_NEXT, 0, obj);
         }