From 7262eae1402f3256606ad1776e35c4a08ed267c3 Mon Sep 17 00:00:00 2001 From: Dhananjay Kumar Date: Thu, 25 Feb 2016 13:48:33 +0530 Subject: nuplayer: ignore openAudioSink while waiting for teardown completion - AudioSink is reopened on AudioTearDown event as well as on decoder output format change. These events are from different contexts, independent of each other and can occur concurrently, doing set of thread-unsafe operations on audioSink, which sometimes may result in fatal error. - Any request to openSink, after teardown event is received but before its completed, is redundant since once teardown is completed sink is anyway going to be opened again. Also ignoring sink reopen while in teardown would avoid concurrent processing of thread-unsafe operations on audioSink. - Update nuplayer to prevent reopening of sink while teardown is still going on. CRs-Fixed: 978013 Change-Id: Ieb3825f133c2099e07d6e92ef101dd5156af8a20 --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 1835101..2ffd184 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -1157,6 +1157,7 @@ void NuPlayer::onMessageReceived(const sp &msg) { mRenderer->flush( false /* audio */, false /* notifyComplete */); } + mRenderer->signalAudioTearDownComplete(); int64_t positionUs; if (!msg->findInt64("positionUs", &positionUs)) { -- cgit v1.1 From 48827966831de92e0190f96820fa6e7d9e149b50 Mon Sep 17 00:00:00 2001 From: Manikanta Kanamarlapudi Date: Tue, 23 Feb 2016 17:25:40 +0530 Subject: nuplayer: Seek to valid position in setVideoSurface - If flush is called on both A/V tracks and video decoder is not yet created, In offload case the first audio buffer will get flush and audio playback starts from timestamp of second buffer, where as video playback starts from zero leads to AV sync issue in start and cause framedrops. - Call seek to current position to align the Audio and Video tracks. Seek to zero if playback has not yet started. Change-Id: I4f75d0aa908714ad292f348fa8bf7aa5f837f8d7 --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 2ffd184..ef2e6ec 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -681,10 +681,9 @@ void NuPlayer::onMessageReceived(const sp &msg) { // If the video decoder is not set (perhaps audio only in this case) // do not perform a seek as it is not needed. int64_t currentPositionUs = 0; - if (getCurrentPosition(¤tPositionUs) == OK) { - mDeferredActions.push_back( - new SeekAction(currentPositionUs)); - } + getCurrentPosition(¤tPositionUs); + mDeferredActions.push_back( + new SeekAction(currentPositionUs)); } // If there is a new surface texture, instantiate decoders -- cgit v1.1