From 5bb889a3df53c9cce08927051799d8319a5acb89 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Tue, 11 Mar 2014 17:48:46 +0200 Subject: [PATCH] waylandsink: Use a boolean in combination with render_cond to comply with GCond's usage documentation --- ext/wayland/gstwaylandsink.c | 12 ++++++++---- ext/wayland/gstwaylandsink.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index ad2474e853..72c709bb92 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -585,6 +585,7 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer) render_last_buffer (sink); /* notify _resume_rendering() in case it's waiting */ + sink->rendered = TRUE; g_cond_broadcast (&sink->render_cond); if (buffer != to_render) @@ -736,11 +737,14 @@ gst_wayland_sink_resume_rendering (GstWaylandVideo * video) GST_OBJECT_LOCK (sink); sink->drawing_frozen = FALSE; - if (GST_STATE (sink) == GST_STATE_PLAYING) - g_cond_wait (&sink->render_cond, GST_OBJECT_GET_LOCK (sink)); - else if (sink->window && sink->last_buffer && - g_atomic_int_get (&sink->redraw_pending) == FALSE) + if (GST_STATE (sink) == GST_STATE_PLAYING) { + sink->rendered = FALSE; + while (sink->rendered == FALSE) + g_cond_wait (&sink->render_cond, GST_OBJECT_GET_LOCK (sink)); + } else if (sink->window && sink->last_buffer && + g_atomic_int_get (&sink->redraw_pending) == FALSE) { render_last_buffer (sink); + } GST_OBJECT_UNLOCK (sink); } diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h index bbbdbb6c4c..38f25acee6 100644 --- a/ext/wayland/gstwaylandsink.h +++ b/ext/wayland/gstwaylandsink.h @@ -63,6 +63,7 @@ struct _GstWaylandSink gboolean redraw_pending; gboolean drawing_frozen; + gboolean rendered; GCond render_cond; GstBuffer *last_buffer; };