From 3b0e43e92b6a81e22e44edabd7688cff8e760500 Mon Sep 17 00:00:00 2001 From: Xiaoming Yang Date: Mon, 11 May 2015 13:48:49 +0800 Subject: NuPlayer: Clear stale track packets on seek EOS isn't notified to nuplayer immediately upon seek. Stale packets before seeking is still held by track, thus EOS won't be returned until all packets are consumed. To fix this issue and align nuplayer's behavior with awesome player, stale packets needs to be cleared on seek. Change-Id: I00d825cad7a9f3de1daf494078e7379dca8eba2e CRs-Fixed: 828785 --- media/libmediaplayerservice/nuplayer/GenericSource.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'media/libmediaplayerservice/nuplayer/GenericSource.cpp') diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp index 3b2bcee..4d003d3 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp +++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp @@ -1498,6 +1498,7 @@ void NuPlayer::GenericSource::readBuffer( if (seekTimeUs >= 0) { options.setSeekTo(seekTimeUs, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC); seeking = true; + track->mPackets->clear(); } if (mIsWidevine) { -- cgit v1.1