mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
decklinkvideo{src,sink}: Sample the internal clock immediately after starting the device
Otherwise we might stay at 0.0s for too long because we will take the first timestamp we ever see as 0.0... which will be after we started the device.
This commit is contained in:
parent
a8033553f9
commit
e8167dd118
1 changed files with 10 additions and 9 deletions
|
@ -664,6 +664,16 @@ gst_decklink_video_src_start_streams (GstElement * element)
|
||||||
|| GST_STATE_PENDING (self) == GST_STATE_PLAYING)) {
|
|| GST_STATE_PENDING (self) == GST_STATE_PLAYING)) {
|
||||||
GST_DEBUG_OBJECT (self, "Starting streams");
|
GST_DEBUG_OBJECT (self, "Starting streams");
|
||||||
|
|
||||||
|
res = self->input->input->StartStreams ();
|
||||||
|
if (res != S_OK) {
|
||||||
|
GST_ELEMENT_ERROR (self, STREAM, FAILED,
|
||||||
|
(NULL), ("Failed to start streams: 0x%08x", res));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self->input->started = TRUE;
|
||||||
|
self->input->clock_restart = TRUE;
|
||||||
|
|
||||||
// Need to unlock to get the clock time
|
// Need to unlock to get the clock time
|
||||||
g_mutex_unlock (&self->input->lock);
|
g_mutex_unlock (&self->input->lock);
|
||||||
|
|
||||||
|
@ -678,15 +688,6 @@ gst_decklink_video_src_start_streams (GstElement * element)
|
||||||
gst_clock_get_internal_time (GST_ELEMENT_CLOCK (self));
|
gst_clock_get_internal_time (GST_ELEMENT_CLOCK (self));
|
||||||
|
|
||||||
g_mutex_lock (&self->input->lock);
|
g_mutex_lock (&self->input->lock);
|
||||||
|
|
||||||
res = self->input->input->StartStreams ();
|
|
||||||
if (res != S_OK) {
|
|
||||||
GST_ELEMENT_ERROR (self, STREAM, FAILED,
|
|
||||||
(NULL), ("Failed to start streams: 0x%08x", res));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self->input->started = TRUE;
|
|
||||||
self->input->clock_restart = TRUE;
|
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (self, "Not starting streams yet");
|
GST_DEBUG_OBJECT (self, "Not starting streams yet");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue