From 380d397b261d7a12d7d1be10756dc93670aeb017 Mon Sep 17 00:00:00 2001 From: Preetam Singh Ranawat Date: Thu, 30 Apr 2015 16:56:51 +0530 Subject: NuPlayer: Fix for PCM offload fallback on BT -Start the Decoded PCM offload playback on speaker or headset and connect BT, audio is not played on BT. -During tear down event on BT connection, instantiation of decoder is initated before actual shut down of decoder completes.So decoder is not getting instantiated again after tear down event. It is a race condition between instantiation of Decoder and shut down of decoder. -Defer the instantiation of decoder in intermediate state CRs-Fixed: 916643, 829392 Change-Id: Ic346cb7bb7b1babe21618daa8f8746c00f4b61b3 --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 86c35e2..aaf6b9e 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -131,6 +131,23 @@ private: DISALLOW_EVIL_CONSTRUCTORS(FlushDecoderAction); }; +struct NuPlayer::InstantiateDecoderAction : public Action { + InstantiateDecoderAction(bool audio, sp *decoder) + : mAudio(audio), + mdecoder(decoder) { + } + + virtual void execute(NuPlayer *player) { + player->instantiateDecoder(mAudio, mdecoder); + } + +private: + bool mAudio; + sp *mdecoder; + + DISALLOW_EVIL_CONSTRUCTORS(InstantiateDecoderAction); +}; + struct NuPlayer::PostMessageAction : public Action { PostMessageAction(const sp &msg) : mMessage(msg) { -- cgit v1.1