Skip to content

Commit 07ff24f

Browse files
committed
avplayer: remove maximum audio delay
1 parent 8a8ee39 commit 07ff24f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/core/libraries/avplayer/avplayer_source.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,10 @@ bool AvPlayerSource::GetVideoData(AvPlayerFrameInfoEx& video_info) {
342342

343343
const auto& new_frame = m_video_frames.Front();
344344
if (m_state.GetSyncMode() == AvPlayerAvSyncMode::Default) {
345-
if (m_audio_codec_context != nullptr) {
346-
// Sync with the audio
347-
auto avdiff = s64(new_frame.info.timestamp) - s64(m_last_audio_ts.value_or(0));
348-
if (avdiff > 69) {
349-
// VIDEO_AHEAD, wait
345+
if (m_audio_stream_index) {
346+
if (new_frame.info.timestamp > m_last_audio_ts.value_or(0)) {
350347
return false;
351348
}
352-
// These will remain unimplemented for now:
353-
// avdiff < -28 = VIDEO_BEHIND, ??? skip frames ???
354-
// -2 < avdiff < 0 = WAIT_FOR_SYNC, ??? loop until synced ???
355349
} else {
356350
// Sync with the internal timer since audio is not available
357351
const auto current_time = CurrentTime();

0 commit comments

Comments
 (0)