decklinkvideosink: Handle the clock returning GST_CLOCK_TIME_NONE properly

This commit is contained in:
Sebastian Dröge 2015-01-28 12:20:05 +01:00
parent 8a5d2c561c
commit b3a4772834

View file

@ -422,11 +422,13 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
// potentially overflowing the internal queue of the hardware
clock = gst_element_get_clock (GST_ELEMENT_CAST (self));
if (clock) {
GstClockTime clock_running_time, latency, max_lateness;
GstClockTime clock_running_time, base_time, clock_time, latency,
max_lateness;
clock_running_time = gst_element_get_base_time (GST_ELEMENT_CAST (self));
if (clock_running_time != GST_CLOCK_TIME_NONE) {
clock_running_time = gst_clock_get_time (clock) - clock_running_time;
base_time = gst_element_get_base_time (GST_ELEMENT_CAST (self));
clock_time = gst_clock_get_time (clock);
if (base_time != GST_CLOCK_TIME_NONE && clock_time != GST_CLOCK_TIME_NONE) {
clock_running_time = clock_time - base_time;
latency = gst_base_sink_get_latency (GST_BASE_SINK_CAST (self));
max_lateness = gst_base_sink_get_max_lateness (GST_BASE_SINK_CAST (self));