From 1020c3150f16b55e507494abc24ffe98e12ffdae Mon Sep 17 00:00:00 2001 From: Vladislav Mikhalin Date: Wed, 1 Oct 2025 22:26:28 +0300 Subject: [PATCH] avplayer: remove maximum audio delay (#3692) --- src/core/libraries/avplayer/avplayer_source.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/libraries/avplayer/avplayer_source.cpp b/src/core/libraries/avplayer/avplayer_source.cpp index fae08e48d..7a4686a6c 100644 --- a/src/core/libraries/avplayer/avplayer_source.cpp +++ b/src/core/libraries/avplayer/avplayer_source.cpp @@ -342,16 +342,10 @@ bool AvPlayerSource::GetVideoData(AvPlayerFrameInfoEx& video_info) { const auto& new_frame = m_video_frames.Front(); if (m_state.GetSyncMode() == AvPlayerAvSyncMode::Default) { - if (m_audio_codec_context != nullptr) { - // Sync with the audio - auto avdiff = s64(new_frame.info.timestamp) - s64(m_last_audio_ts.value_or(0)); - if (avdiff > 69) { - // VIDEO_AHEAD, wait + if (m_audio_stream_index) { + if (new_frame.info.timestamp > m_last_audio_ts.value_or(0)) { return false; } - // These will remain unimplemented for now: - // avdiff < -28 = VIDEO_BEHIND, ??? skip frames ??? - // -2 < avdiff < 0 = WAIT_FOR_SYNC, ??? loop until synced ??? } else { // Sync with the internal timer since audio is not available const auto current_time = CurrentTime();