Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98e7ece3 authored by Shivaprasad Hongal's avatar Shivaprasad Hongal Committed by Wei Jia
Browse files

nuplayer: Fix incorrect audio resume time during seek

GenericSource uses the timestamp of last video buffer
read in readBuffer() to seek audio, due to which audio
starts at a later position leading to frame drops.

Add change to use the first video sample timestamp
to seek audio

Bug: 22770523

CRs-Fixed: 780094
Author: Xavier Varricatt <xvarrica@codeaurora.org>
Change-Id: I5f2061e67994a3a0330b527bd3164ee04ed04005
parent bee2132c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1521,7 +1521,8 @@ void NuPlayer::GenericSource::readBuffer(
            queueDiscontinuityIfNeeded(seeking, formatChange, trackType, track);
            queueDiscontinuityIfNeeded(seeking, formatChange, trackType, track);


            sp<ABuffer> buffer = mediaBufferToABuffer(
            sp<ABuffer> buffer = mediaBufferToABuffer(
                    mbuf, trackType, seekTimeUs, actualTimeUs);
                    mbuf, trackType, seekTimeUs,
                    numBuffers == 0 ? actualTimeUs : NULL);
            track->mPackets->queueAccessUnit(buffer);
            track->mPackets->queueAccessUnit(buffer);
            formatChange = false;
            formatChange = false;
            seeking = false;
            seeking = false;