diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-01-28 16:58:27 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-01-28 16:59:30 +0100 |
commit | 837eee708596853915be86142c87520b7c7659b9 (patch) | |
tree | a978d6a815c882a9bd538cbc82795be02d184db5 /sys/decklink | |
parent | 4eb5cd915614c25f6bf6eee9366d18dac5cf8bab (diff) | |
download | gstreamer-plugins-bad-837eee708596853915be86142c87520b7c7659b9.tar.gz |
decklinkvideosink: Fix deadlock
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklinkvideosink.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp index d2d67bccc..6f3f1a1a2 100644 --- a/sys/decklink/gstdecklinkvideosink.cpp +++ b/sys/decklink/gstdecklinkvideosink.cpp @@ -580,6 +580,9 @@ gst_decklink_video_sink_start_scheduled_playback (GstElement * element) || self->output->audio_enabled) && (GST_STATE (self) == GST_STATE_PLAYING || GST_STATE_PENDING (self) == GST_STATE_PLAYING)) { + // Need to unlock to get the clock time + g_mutex_unlock (&self->output->lock); + // FIXME: start time is the same for the complete pipeline, // but what we need here is the start time of this element! start_time = gst_element_get_base_time (element); @@ -603,14 +606,17 @@ gst_decklink_video_sink_start_scheduled_playback (GstElement * element) convert_to_internal_clock (self, &start_time, NULL); + g_mutex_lock (&self->output->lock); + // Check if someone else started in the meantime + if (self->output->started) + return; + active = false; self->output->output->IsScheduledPlaybackRunning (&active); if (active) { GST_DEBUG_OBJECT (self, "Stopping scheduled playback"); - g_mutex_lock (&self->output->lock); self->output->started = FALSE; - g_mutex_unlock (&self->output->lock); res = self->output->output->StopScheduledPlayback (0, 0, 0); if (res != S_OK) { |