waylandsink: do not render twice the same buffer
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 7 Oct 2014 08:37:33 +0000 (10:37 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Sat, 11 Oct 2014 15:35:41 +0000 (17:35 +0200)
Do not try to render a buffer that is already being rendered.
This happens typically during the initial rendering stage as the first
buffer is rendered twice: first by preroll(), then by render().
This commit avoids this assertion failure:
  CRITICAL: gst_wayland_compositor_acquire_buffer: assertion
  'meta->used_by_compositor == FALSE' failed

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

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
ext/wayland/gstwaylandsink.c

index 363b31bc48441a278ba317e9cc9379571d516949..d666a201ca8ef94978d4dfaa3927af5babcce015 100644 (file)
@@ -667,6 +667,12 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
     }
   }
 
+  /* drop double rendering */
+  if (G_UNLIKELY (to_render == sink->last_buffer)) {
+    GST_LOG_OBJECT (sink, "Buffer already being rendered");
+    goto done;
+  }
+
   gst_buffer_replace (&sink->last_buffer, to_render);
   render_last_buffer (sink);