assrender: Mark pad as needing reconfiguration again if reconfiguration failed
authorSebastian Dröge <sebastian@centricular.com>
Thu, 17 Nov 2016 18:16:49 +0000 (20:16 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 18 Nov 2016 10:22:44 +0000 (12:22 +0200)
Also return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

https://bugzilla.gnome.org/show_bug.cgi?id=774623

ext/assrender/gstassrender.c

index b4e385bbe66c47f49ca453370fb560f92a0dd3b9..1dbc4d1a84929264feaf700b7cc3ff29ff585067 100644 (file)
@@ -930,12 +930,16 @@ gst_ass_render_negotiate (GstAssRender * render, GstCaps * caps)
   gst_caps_unref (overlay_caps);
   gst_caps_unref (caps);
 
+  if (!ret)
+    gst_pad_mark_reconfigure (render->srcpad);
+
   return ret;
 
 no_format:
   {
     if (caps)
       gst_caps_unref (caps);
+    gst_pad_mark_reconfigure (render->srcpad);
     return FALSE;
   }
 }
@@ -1160,8 +1164,15 @@ gst_ass_render_chain_video (GstPad * pad, GstObject * parent,
   guint64 start, stop, clip_start = 0, clip_stop = 0;
   ASS_Image *ass_image;
 
-  if (gst_pad_check_reconfigure (render->srcpad))
-    gst_ass_render_negotiate (render, NULL);
+  if (gst_pad_check_reconfigure (render->srcpad)) {
+    if (!gst_ass_render_negotiate (render, NULL)) {
+      gst_pad_mark_reconfigure (render->srcpad);
+      if (GST_PAD_IS_FLUSHING (render->srcpad))
+        goto flushing;
+      else
+        goto not_negotiated;
+    }
+  }
 
   if (!GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
     goto missing_timestamp;
@@ -1379,6 +1390,13 @@ missing_timestamp:
     gst_buffer_unref (buffer);
     return GST_FLOW_OK;
   }
+not_negotiated:
+  {
+    GST_ASS_RENDER_UNLOCK (render);
+    GST_DEBUG_OBJECT (render, "not negotiated");
+    gst_buffer_unref (buffer);
+    return GST_FLOW_NOT_NEGOTIATED;
+  }
 flushing:
   {
     GST_ASS_RENDER_UNLOCK (render);