From 2ab19144be6784f230bbda55fbd238ef5ab41f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Feb 2017 17:11:37 +0200 Subject: [PATCH] decklinkvideosink: Show video frames synchronously in PAUSED Otherwise we will only show the preroll frame once PLAYING is reached, which is rather suboptimal for e.g. seeking in PAUSED. --- sys/decklink/gstdecklinkvideosink.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp index 4881ff8e03..93cf0a5f92 100644 --- a/sys/decklink/gstdecklinkvideosink.cpp +++ b/sys/decklink/gstdecklinkvideosink.cpp @@ -661,6 +661,17 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer) convert_to_internal_clock (self, &running_time, &running_time_duration); + if (!self->output->started) { + GST_LOG_OBJECT (self, "Showing video frame synchronously because PAUSED"); + ret = self->output->output->DisplayVideoFrameSync (frame); + if (ret != S_OK) { + GST_ELEMENT_ERROR (self, STREAM, FAILED, + (NULL), ("Failed to show video frame synchronously: 0x%08x", ret)); + flow_ret = GST_FLOW_ERROR; + goto out; + } + } + GST_LOG_OBJECT (self, "Scheduling video frame %p at %" GST_TIME_FORMAT " with duration %" GST_TIME_FORMAT, frame, GST_TIME_ARGS (running_time), GST_TIME_ARGS (running_time_duration));