+2004-10-06 Wim Taymans <wim at fluendo dot com>
+
+ * gst/gstthread.c: (gst_thread_init), (gst_thread_change_state),
+ (gst_thread_main_loop):
+ Lock the iteration and the state change so that automatic
+ negotiation and fixation does not happen at the same time
+ as the in stream negotiation.
+
2004-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
thread->lock = g_mutex_new ();
thread->cond = g_cond_new ();
+ thread->iterate_lock = g_mutex_new ();
thread->thread_id = (GThread *) NULL; /* set in NULL -> READY */
thread->priority = G_THREAD_PRIORITY_NORMAL;
GST_LOG_OBJECT (thread, "unlocking lock");
g_mutex_unlock (thread->lock);
+ g_mutex_lock (thread->iterate_lock);
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
ret = GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT (thread));
} else {
ret = GST_STATE_SUCCESS;
}
+ g_mutex_unlock (thread->iterate_lock);
return ret;
gboolean status;
g_mutex_unlock (thread->lock);
+ g_mutex_lock (thread->iterate_lock);
status = gst_bin_iterate (GST_BIN (thread));
+ g_mutex_unlock (thread->iterate_lock);
g_mutex_lock (thread->lock);
if (!status) {
GMutex *lock; /* thread lock/condititon pairs */
GCond *cond; /* used to control the thread */
- gpointer _gst_reserved[GST_PADDING];
+ GMutex *iterate_lock; /* lock iteration in state change */
+
+ gpointer _gst_reserved[GST_PADDING-1];
};
struct _GstThreadClass {