assrender: Don't try unlocking unlocked mutex
authorSebastian Dröge <sebastian@centricular.com>
Tue, 29 Dec 2020 11:15:10 +0000 (13:15 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 29 Dec 2020 11:19:53 +0000 (11:19 +0000)
When flushing right at the beginning of the video chain function or
when failing negotiation at the top of the function, the assrender mutex
would be unlocked without being previously locked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1918>

ext/assrender/gstassrender.c

index e99458b..e6d3198 100644 (file)
@@ -1171,7 +1171,7 @@ gst_ass_render_chain_video (GstPad * pad, GstObject * parent,
     if (!gst_ass_render_negotiate (render, NULL)) {
       gst_pad_mark_reconfigure (render->srcpad);
       if (GST_PAD_IS_FLUSHING (render->srcpad))
-        goto flushing;
+        goto flushing_no_unlock;
       else
         goto not_negotiated;
     }
@@ -1443,7 +1443,6 @@ missing_timestamp:
   }
 not_negotiated:
   {
-    GST_ASS_RENDER_UNLOCK (render);
     GST_DEBUG_OBJECT (render, "not negotiated");
     gst_buffer_unref (buffer);
     return GST_FLOW_NOT_NEGOTIATED;
@@ -1451,6 +1450,9 @@ not_negotiated:
 flushing:
   {
     GST_ASS_RENDER_UNLOCK (render);
+  }
+flushing_no_unlock:
+  {
     GST_DEBUG_OBJECT (render, "flushing, discarding buffer");
     gst_buffer_unref (buffer);
     return GST_FLOW_FLUSHING;