Skip to content

Commit

Permalink
DeckLink disp.: fixed stream discontinuity detection
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Jul 18, 2023
1 parent 44e3bb4 commit 524034c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/video_display/decklink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,16 +1587,16 @@ void PlaybackDelegate::ScheduleAudio(const struct audio_frame *frame,
// (everything except vidcap testcard and decklink).
const int64_t diff = llabs(streamTime - m_last_sched_audio_time);
const int64_t avg_diff = (m_avg_diff * 39 + diff) / 40;
if (m_avg_diff >= 50 && m_last_sched_audio_time >= 0) {
if (avg_diff >= 50 && m_last_sched_audio_time >= 0) {
log_msg_once(LOG_LEVEL_WARNING, 0x61c30d43,
"Stream discontinuity, auto-"
"adjusting audio time. If this is "
"an unsynchronized stream, do not "
"use synchronized output.\n");
streamTime = m_last_sched_audio_time;
if (diff < 2000) { // do not store Martians
m_avg_diff = avg_diff;
}
}
if (diff < 2000) { // do not store Martians
m_avg_diff = avg_diff;
}

m_last_sched_audio_time = streamTime + *samples;
Expand Down

0 comments on commit 524034c

Please sign in to comment.