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:
Sebastian Dröge 2015-03-02 16:45:45 +01:00
parent 8e362aab14
commit 4521524de3
2 changed files with 4 additions and 0 deletions

View file

@ -705,6 +705,8 @@ gst_decklink_video_sink_change_state (GstElement * element,
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
self->output->clock));
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);
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
self->output->clock_last_time = 0;

View file

@ -765,6 +765,8 @@ gst_decklink_video_src_change_state (GstElement * element,
gst_message_new_clock_lost (GST_OBJECT_CAST (element),
self->input->clock));
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);
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
self->input->clock_last_time = 0;