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') 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