From 2b95bda111444f2834e64221e3a3eb1a87d43c38 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Wed, 22 Jul 2015 10:11:51 -0700 Subject: Explicitly disconnect in MediaPlayer::reset Even without calling disconnect in MediaPlayer::reset, MediaPlayerService::Client (which lives on the other side of a binder with MediaPlayer) would still perform a disconnect in its destructor. Object destruction across binder is not synchronous, but method calls are. This commit merely makes sure that the disconnect happens deterministically before reset returns. Bug: 22451733 Change-Id: Id9146a63a1872d68087a252aa614248b16d2556d --- media/libmedia/mediaplayer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'media/libmedia/mediaplayer.cpp') diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index c215abf..502ab2d 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -574,6 +574,7 @@ status_t MediaPlayer::reset_l() ALOGE("reset() failed with return code (%d)", ret); mCurrentState = MEDIA_PLAYER_STATE_ERROR; } else { + mPlayer->disconnect(); mCurrentState = MEDIA_PLAYER_IDLE; } // setDataSource has to be called again to create a -- cgit v1.1