Skip to content

Commit

Permalink
Honor Softstartflag
Browse files Browse the repository at this point in the history
  • Loading branch information
jojo61 committed Apr 1, 2020
1 parent a6e65d9 commit 5875e10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions video.c
Original file line number Diff line number Diff line change
Expand Up @@ -4347,13 +4347,14 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
decoder->TrickCounter = decoder->TrickSpeed;
goto skip_sync;
}
#if 0
// at start of new video stream, soft or hard sync video to audio
if (!VideoSoftStartSync && decoder->StartCounter < VideoSoftStartFrames && video_clock != (int64_t) AV_NOPTS_VALUE
&& (audio_clock == (int64_t) AV_NOPTS_VALUE || video_clock > audio_clock + VideoAudioDelay + 120 * 90)) {
Debug(4, "video: initial slow down video, frame %d\n", decoder->StartCounter);
goto skip_sync;
}

#endif
if (decoder->SyncCounter && decoder->SyncCounter--) {
goto skip_sync;
}
Expand All @@ -4378,10 +4379,10 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
goto skip_sync;

} else if (diff > 100 * 90) {
// FIXME: this quicker sync step, did not work with new code!

err = CuvidMessage(4, "video: slow down video, duping frame %d\n", diff / 90);
++decoder->FramesDuped;
if (speedup && --speedup)
if ((speedup && --speedup) || VideoSoftStartSync)
decoder->SyncCounter = 1;
else
decoder->SyncCounter = 0;
Expand All @@ -4404,7 +4405,7 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
decoder->SyncCounter = 1;
}
else {
speedup = 3;
speedup = 2;
}
#if defined(DEBUG) || defined(AV_INFO)
if (!decoder->SyncCounter && decoder->StartCounter < 1000) {
Expand Down

0 comments on commit 5875e10

Please sign in to comment.