mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
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.
This commit is contained in:
parent
733c109ce9
commit
b4b911da4d
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue