Skip to content

Commit

Permalink
refactor(player): use getAudioPlayTimeStamp to check delay
Browse files Browse the repository at this point in the history
  • Loading branch information
skufly authored and pingkai committed Apr 16, 2020
1 parent 51919e0 commit 56571ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,13 @@ namespace Cicada {
int64_t lastAudio = mBufferController.GetPacketLastPTS(BUFFER_TYPE_AUDIO);

if ((lastAudio != INT64_MIN) && (mPlayedAudioPts != INT64_MIN)) {
int64_t delayTime = lastAudio - mPlayedAudioPts;
int64_t playTime = getAudioPlayTimeStamp();

if (INT64_MIN == playTime) {
playTime = mPlayedAudioPts;
}

int64_t delayTime = lastAudio - playTime;
static int64_t lastT = af_gettime_ms();

if (af_gettime_ms() - lastT > 1000) {
Expand Down

0 comments on commit 56571ba

Please sign in to comment.