Skip to content

Commit

Permalink
fix(supermediaplayer): fix pos error on seek
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Aug 14, 2020
1 parent e76949d commit 2f76533
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,17 @@ void SuperMediaPlayer::doRender()

if (rendered) {
AF_LOGD("TIMEPOS RenderVideo :%lld", mPlayedVideoPts / 1000);
mMasterClock.setTime(mPlayedVideoPts);

/*
* set the position to video position tmp, audio will update the position when it rendered,
* otherwise the position will update to the old audio position when audio not reach on time after seek.
*
*/
if (mSoughtVideoPos != INT64_MIN) {
mCurrentPos = mSoughtVideoPos;
} else {
mCurrentPos = mPlayedVideoPts;
}
NotifyPosition(getCurrentPosition() / 1000);

// seek preview can't render audio,but set the audio clock to here pts
Expand Down

0 comments on commit 2f76533

Please sign in to comment.