2005-06-25 Wim Taymans <wim@fluendo.com>
+ * gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
+ (gst_basesink_handle_object), (gst_basesink_event),
+ (gst_basesink_do_sync), (gst_basesink_handle_event),
+ (gst_basesink_change_state):
+ * gst/gsttask.h:
+ Right, two problems here: ghostpads don't take locks and
+ glib _rec_mutex_lock_full() with depth==0 still locks.
+ Catch illegal locking and g_warn them.
+
+2005-06-25 Wim Taymans <wim@fluendo.com>
+
* check/states/sinks.c: (START_TEST), (gst_object_suite):
Have to check for completion now...
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
* inside the STREAM_LOCK */
t = GST_STREAM_UNLOCK_FULL (pad);
+ GST_DEBUG ("released stream lock %d times", t);
+ if (t == 0) {
+ GST_WARNING ("STREAM_LOCK should have been locked !!");
+ g_warning ("STREAM_LOCK should have been locked !!");
+ }
/* now we commit our state */
GST_STATE_LOCK (basesink);
GST_STATE_UNLOCK (basesink);
/* reacquire stream lock, pad could be flushing now */
- GST_STREAM_LOCK_FULL (pad, t);
+ /* FIXME in glib, if t==0, the lock is still taken... hmmm */
+ if (t > 0)
+ GST_STREAM_LOCK_FULL (pad, t);
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
#define GST_TASK_GET_LOCK(task) (GST_TASK_CAST(task)->lock)
#define GST_TASK_LOCK(task) g_static_rec_mutex_lock(GST_TASK_GET_LOCK(task))
#define GST_TASK_UNLOCK(task) g_static_rec_mutex_unlock(GST_TASK_GET_LOCK(task))
+#define GST_TASK_UNLOCK_FULL(task) g_static_rec_mutex_unlock_full(GST_TASK_GET_LOCK(task))
+#define GST_TASK_LOCK_FULL(task,t) g_static_rec_mutex_lock_full(GST_TASK_GET_LOCK(task),(t))
struct _GstTask {
GstObject object;
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
* inside the STREAM_LOCK */
t = GST_STREAM_UNLOCK_FULL (pad);
+ GST_DEBUG ("released stream lock %d times", t);
+ if (t == 0) {
+ GST_WARNING ("STREAM_LOCK should have been locked !!");
+ g_warning ("STREAM_LOCK should have been locked !!");
+ }
/* now we commit our state */
GST_STATE_LOCK (basesink);
GST_STATE_UNLOCK (basesink);
/* reacquire stream lock, pad could be flushing now */
- GST_STREAM_LOCK_FULL (pad, t);
+ /* FIXME in glib, if t==0, the lock is still taken... hmmm */
+ if (t > 0)
+ GST_STREAM_LOCK_FULL (pad, t);
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))