diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-02-10 14:48:09 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-02-10 14:48:09 +0100 |
commit | e8167dd1180a38d1562bad147a54d6d8667c379e (patch) | |
tree | 6cc8d26d7ed2f81c5f6582df602ea8758bc0f1a3 /sys/decklink | |
parent | a8033553f9e69fc583df0dc8811acb6b53a7e75e (diff) | |
download | gstreamer-plugins-bad-e8167dd1180a38d1562bad147a54d6d8667c379e.tar.gz |
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.
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklinkvideosrc.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/decklink/gstdecklinkvideosrc.cpp b/sys/decklink/gstdecklinkvideosrc.cpp index 8ca3cbde2..08d8b287a 100644 --- a/sys/decklink/gstdecklinkvideosrc.cpp +++ b/sys/decklink/gstdecklinkvideosrc.cpp @@ -664,6 +664,16 @@ gst_decklink_video_src_start_streams (GstElement * element) || GST_STATE_PENDING (self) == GST_STATE_PLAYING)) { 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 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)); 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 { GST_DEBUG_OBJECT (self, "Not starting streams yet"); } |