diff --git a/nodes/decklink-out/src/decklink_out_node.cpp b/nodes/decklink-out/src/decklink_out_node.cpp index e770e10..9e55119 100644 --- a/nodes/decklink-out/src/decklink_out_node.cpp +++ b/nodes/decklink-out/src/decklink_out_node.cpp @@ -190,6 +190,7 @@ bool DeckLinkOutNode::open_device() { frame->Release(); } + stream_frame_ = preroll_frames_; if (output_->StartScheduledPlayback(0, time_scale_, 1.0) != S_OK) { spdlog::error("DeckLink-out: failed to start scheduled playback"); return false; @@ -267,9 +268,10 @@ void DeckLinkOutNode::schedule_frame(void* mxl_payload, long width, long height, buf->Release(); } - auto stream_time = grains_read_ * frame_duration_; + auto stream_time = stream_frame_ * frame_duration_; output_->ScheduleVideoFrame(frame, stream_time, frame_duration_, time_scale_); frame->Release(); + stream_frame_++; } void DeckLinkOutNode::process() { diff --git a/nodes/decklink-out/src/decklink_out_node.hpp b/nodes/decklink-out/src/decklink_out_node.hpp index 31298a0..192c5fa 100644 --- a/nodes/decklink-out/src/decklink_out_node.hpp +++ b/nodes/decklink-out/src/decklink_out_node.hpp @@ -62,6 +62,7 @@ private: std::atomic playing_{false}; int create_fail_count_ = 0; + uint64_t stream_frame_ = 0; bool is_interlaced_ = false; long out_width_ = 1920; long out_height_ = 1080;