diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2019-07-22 17:57:01 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2019-07-25 12:29:22 +0300 |
commit | b4b911da4d97ad3467380c9721b7130a1ded0aa9 (patch) | |
tree | 3e522bb0ba043d9db04d0cf8b87e16060b75f3bd /sys/decklink | |
parent | 733c109ce962ad2d6380bbe8f165f25aad475fa8 (diff) | |
download | gstreamer-plugins-bad-b4b911da4d97ad3467380c9721b7130a1ded0aa9.tar.gz |
decklinksrc: Reset timestamp observations on format change
We will usually get timestamps starting from 0 again and due to the
format change the clock of the input might also be different.
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklink.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index fd42eabf8..7ede6aa96 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -887,6 +887,27 @@ public: m_input->input->EnableVideoInput (mode->GetDisplayMode (), pixelFormat, bmdVideoInputEnableFormatDetection); m_input->input->FlushStreams (); + + /* Reset any timestamp observations we might've made */ + if (m_input->videosrc) { + GstDecklinkVideoSrc *videosrc = GST_DECKLINK_VIDEO_SRC (m_input->videosrc); + + g_mutex_lock (&videosrc->lock); + videosrc->window_fill = 0; + videosrc->window_filled = FALSE; + videosrc->window_skip = 1; + videosrc->window_skip_count = 0; + videosrc->current_time_mapping.xbase = 0; + videosrc->current_time_mapping.b = 0; + videosrc->current_time_mapping.num = 1; + videosrc->current_time_mapping.den = 1; + videosrc->next_time_mapping.xbase = 0; + videosrc->next_time_mapping.b = 0; + videosrc->next_time_mapping.num = 1; + videosrc->next_time_mapping.den = 1; + g_mutex_unlock (&videosrc->lock); + } + m_input->input->StartStreams (); m_input->mode = gst_decklink_get_mode (gst_decklink_get_mode_enum_from_bmd |