decklink2sink: Don't hold lock while stopping

Driver may wait for callback thread to join() but we takes the same
lock there
This commit is contained in:
Seungha Yang 2023-06-30 21:39:49 +09:00
parent ff34a9ee42
commit 37c760e8f9

View file

@ -1099,6 +1099,7 @@ gst_decklink2_output_stop_internal (GstDeckLink2Output * self)
std::unique_lock < std::mutex > lk (priv->schedule_lock); std::unique_lock < std::mutex > lk (priv->schedule_lock);
/* Steal last frame to avoid re-rendering */ /* Steal last frame to avoid re-rendering */
GST_DECKLINK2_CLEAR_COM (self->last_frame); GST_DECKLINK2_CLEAR_COM (self->last_frame);
lk.unlock ();
switch (self->api_level) { switch (self->api_level) {
case GST_DECKLINK2_API_LEVEL_10_11: case GST_DECKLINK2_API_LEVEL_10_11:
@ -1115,7 +1116,6 @@ gst_decklink2_output_stop_internal (GstDeckLink2Output * self)
g_assert_not_reached (); g_assert_not_reached ();
break; break;
} }
lk.unlock ();
GST_DEBUG_OBJECT (self, "StopScheduledPlayback result 0x%x", (guint) hr); GST_DEBUG_OBJECT (self, "StopScheduledPlayback result 0x%x", (guint) hr);