From: Tim-Philipp Müller Date: Wed, 18 Jan 2012 17:21:02 +0000 (+0000) Subject: pango: port to new GLib threading API X-Git-Tag: RELEASE-0.11.2~140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa0464cd7aaca65b94095d34c30fb250d4182e64;p=platform%2Fupstream%2Fgst-plugins-base.git pango: port to new GLib threading API --- diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index df036ae..848348e 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -294,9 +294,9 @@ gst_base_text_overlay_line_align_get_type (void) } #define GST_BASE_TEXT_OVERLAY_GET_COND(ov) (((GstBaseTextOverlay *)ov)->cond) -#define GST_BASE_TEXT_OVERLAY_WAIT(ov) (g_cond_wait (GST_BASE_TEXT_OVERLAY_GET_COND (ov), GST_OBJECT_GET_LOCK (ov))) -#define GST_BASE_TEXT_OVERLAY_SIGNAL(ov) (g_cond_signal (GST_BASE_TEXT_OVERLAY_GET_COND (ov))) -#define GST_BASE_TEXT_OVERLAY_BROADCAST(ov)(g_cond_broadcast (GST_BASE_TEXT_OVERLAY_GET_COND (ov))) +#define GST_BASE_TEXT_OVERLAY_WAIT(ov) (g_cond_wait (&GST_BASE_TEXT_OVERLAY_GET_COND (ov), GST_OBJECT_GET_LOCK (ov))) +#define GST_BASE_TEXT_OVERLAY_SIGNAL(ov) (g_cond_signal (&GST_BASE_TEXT_OVERLAY_GET_COND (ov))) +#define GST_BASE_TEXT_OVERLAY_BROADCAST(ov)(g_cond_broadcast (&GST_BASE_TEXT_OVERLAY_GET_COND (ov))) static GstElementClass *parent_class = NULL; static void gst_base_text_overlay_base_init (gpointer g_class); @@ -418,7 +418,8 @@ gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass) gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_base_text_overlay_change_state); - klass->pango_lock = g_mutex_new (); + klass->pango_lock = g_slice_new (GMutex); + g_mutex_init (klass->pango_lock); klass->get_text = gst_base_text_overlay_get_text; @@ -597,10 +598,7 @@ gst_base_text_overlay_finalize (GObject * object) overlay->text_buffer = NULL; } - if (overlay->cond) { - g_cond_free (overlay->cond); - overlay->cond = NULL; - } + g_cond_clear (&overlay->cond); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -690,7 +688,7 @@ gst_base_text_overlay_init (GstBaseTextOverlay * overlay, overlay->text_buffer = NULL; overlay->text_linked = FALSE; - overlay->cond = g_cond_new (); + g_cond_init (&overlay->cond); gst_segment_init (&overlay->segment, GST_FORMAT_TIME); g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock); } diff --git a/ext/pango/gstbasetextoverlay.h b/ext/pango/gstbasetextoverlay.h index cb703c9..d756615 100644 --- a/ext/pango/gstbasetextoverlay.h +++ b/ext/pango/gstbasetextoverlay.h @@ -109,7 +109,7 @@ struct _GstBaseTextOverlay { gboolean text_flushing; gboolean text_eos; - GCond *cond; /* to signal removal of a queued text + GCond cond; /* to signal removal of a queued text * buffer, arrival of a text buffer, * a text segment update, or a change * in status (e.g. shutdown, flushing) */