1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

Honor Softstartflag

This commit is contained in:
jojo61 2020-04-01 12:45:33 +02:00
parent a6e65d953e
commit 5875e10479

View File

@ -4347,13 +4347,14 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
decoder->TrickCounter = decoder->TrickSpeed; decoder->TrickCounter = decoder->TrickSpeed;
goto skip_sync; goto skip_sync;
} }
#if 0
// at start of new video stream, soft or hard sync video to audio // 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 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)) { && (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); Debug(4, "video: initial slow down video, frame %d\n", decoder->StartCounter);
goto skip_sync; goto skip_sync;
} }
#endif
if (decoder->SyncCounter && decoder->SyncCounter--) { if (decoder->SyncCounter && decoder->SyncCounter--) {
goto skip_sync; goto skip_sync;
} }
@ -4378,10 +4379,10 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
goto skip_sync; goto skip_sync;
} else if (diff > 100 * 90) { } 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); err = CuvidMessage(4, "video: slow down video, duping frame %d\n", diff / 90);
++decoder->FramesDuped; ++decoder->FramesDuped;
if (speedup && --speedup) if ((speedup && --speedup) || VideoSoftStartSync)
decoder->SyncCounter = 1; decoder->SyncCounter = 1;
else else
decoder->SyncCounter = 0; decoder->SyncCounter = 0;
@ -4404,7 +4405,7 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
decoder->SyncCounter = 1; decoder->SyncCounter = 1;
} }
else { else {
speedup = 3; speedup = 2;
} }
#if defined(DEBUG) || defined(AV_INFO) #if defined(DEBUG) || defined(AV_INFO)
if (!decoder->SyncCounter && decoder->StartCounter < 1000) { if (!decoder->SyncCounter && decoder->StartCounter < 1000) {