fix decklink-out: use stream_frame_ counter for DeckLink scheduling instead of TAI-based grains_read_

This commit is contained in:
Johanness
2026-05-30 23:26:51 +03:00
parent b434c61b86
commit 4402fb2e12
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -190,6 +190,7 @@ bool DeckLinkOutNode::open_device() {
frame->Release(); frame->Release();
} }
stream_frame_ = preroll_frames_;
if (output_->StartScheduledPlayback(0, time_scale_, 1.0) != S_OK) { if (output_->StartScheduledPlayback(0, time_scale_, 1.0) != S_OK) {
spdlog::error("DeckLink-out: failed to start scheduled playback"); spdlog::error("DeckLink-out: failed to start scheduled playback");
return false; return false;
@@ -267,9 +268,10 @@ void DeckLinkOutNode::schedule_frame(void* mxl_payload, long width, long height,
buf->Release(); 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_); output_->ScheduleVideoFrame(frame, stream_time, frame_duration_, time_scale_);
frame->Release(); frame->Release();
stream_frame_++;
} }
void DeckLinkOutNode::process() { void DeckLinkOutNode::process() {
@@ -62,6 +62,7 @@ private:
std::atomic<bool> playing_{false}; std::atomic<bool> playing_{false};
int create_fail_count_ = 0; int create_fail_count_ = 0;
uint64_t stream_frame_ = 0;
bool is_interlaced_ = false; bool is_interlaced_ = false;
long out_width_ = 1920; long out_width_ = 1920;
long out_height_ = 1080; long out_height_ = 1080;