fix decklink-out: init grains_read from current time to avoid epoch realignment
This commit is contained in:
@@ -226,6 +226,13 @@ void DeckLinkOutNode::process() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (first_frame_) {
|
||||
auto now = mxlGetTime();
|
||||
grains_read_ = mxlTimestampToIndex(&output_rate_, now);
|
||||
first_frame_ = false;
|
||||
spdlog::info("DeckLink-out: starting at output index {}", grains_read_);
|
||||
}
|
||||
|
||||
auto deadline = mxlIndexToTimestamp(&output_rate_, grains_read_ + 1);
|
||||
mxlSleepUntil(deadline);
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ private:
|
||||
mxlRational output_rate_{50, 1};
|
||||
uint64_t read_index_ = 0;
|
||||
uint64_t grains_read_ = 0;
|
||||
bool first_frame_ = true;
|
||||
|
||||
int device_index_ = 0;
|
||||
BMDDisplayMode display_mode_ = bmdModeHD1080i50;
|
||||
|
||||
Reference in New Issue
Block a user