decklink: Reset the clock calibration when unsetting the master clock
Otherwise the old calibration will stick around for the next time we use it, potentially giving us completely wrong times.
This commit is contained in:
parent
8e362aab14
commit
4521524de3
@ -705,6 +705,8 @@ gst_decklink_video_sink_change_state (GstElement * element,
|
|||||||
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
|
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
|
||||||
self->output->clock));
|
self->output->clock));
|
||||||
gst_clock_set_master (self->output->clock, NULL);
|
gst_clock_set_master (self->output->clock, NULL);
|
||||||
|
// Reset calibration to make the clock reusable next time we use it
|
||||||
|
gst_clock_set_calibration (self->output->clock, 0, 0, 1, 1);
|
||||||
g_mutex_lock (&self->output->lock);
|
g_mutex_lock (&self->output->lock);
|
||||||
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
|
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
|
||||||
self->output->clock_last_time = 0;
|
self->output->clock_last_time = 0;
|
||||||
|
@ -765,6 +765,8 @@ gst_decklink_video_src_change_state (GstElement * element,
|
|||||||
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
|
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
|
||||||
self->input->clock));
|
self->input->clock));
|
||||||
gst_clock_set_master (self->input->clock, NULL);
|
gst_clock_set_master (self->input->clock, NULL);
|
||||||
|
// Reset calibration to make the clock reusable next time we use it
|
||||||
|
gst_clock_set_calibration (self->input->clock, 0, 0, 1, 1);
|
||||||
g_mutex_lock (&self->input->lock);
|
g_mutex_lock (&self->input->lock);
|
||||||
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
|
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
|
||||||
self->input->clock_last_time = 0;
|
self->input->clock_last_time = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user