From 06ab4b7831ab946f1015ab4ad5ae8cbbcc78f077 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 29 Jun 2005 11:10:44 +0000 Subject: [PATCH] gst/base/gstbasesink.c: Small debug line. Original commit message from CVS: * gst/base/gstbasesink.c: (gst_base_sink_handle_object), (gst_base_sink_change_state): Small debug line. * gst/gstclock.h: map SIGNAL and BROADCAST to the right function. * gst/gstobject.h: Remove redundant braces. * gst/gstpad.c: (gst_pad_set_caps): Don't call setcaps function when reseting caps to NULL. * gst/gstsystemclock.c: (gst_system_clock_dispose), (gst_system_clock_async_thread), (gst_system_clock_id_wait_async), (gst_system_clock_id_unschedule): Use BROADCAST as this is what we do. --- ChangeLog | 20 ++++++++++++++++++++ common | 2 +- gst/base/gstbasesink.c | 2 ++ gst/gstclock.h | 2 +- gst/gstobject.h | 6 +++--- gst/gstpad.c | 2 +- gst/gstsystemclock.c | 10 +++++----- libs/gst/base/gstbasesink.c | 2 ++ 8 files changed, 35 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 848573ec83..bfdcf05c65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2005-06-29 Wim Taymans + + * gst/base/gstbasesink.c: (gst_base_sink_handle_object), + (gst_base_sink_change_state): + Small debug line. + + * gst/gstclock.h: + map SIGNAL and BROADCAST to the right function. + + * gst/gstobject.h: + Remove redundant braces. + + * gst/gstpad.c: (gst_pad_set_caps): + Don't call setcaps function when reseting caps to NULL. + + * gst/gstsystemclock.c: (gst_system_clock_dispose), + (gst_system_clock_async_thread), (gst_system_clock_id_wait_async), + (gst_system_clock_id_unschedule): + Use BROADCAST as this is what we do. + 2005-06-29 Wim Taymans * gst/base/gstbasesink.c: (gst_base_sink_handle_object): diff --git a/common b/common index d6e46b214f..2826306411 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit d6e46b214fac0ecb46010ff522af2f7653e1c18e +Subproject commit 2826306411790bf8aa9298922aa59b126897431f diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index d7f53dcf91..be4c2bb36e 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -966,6 +966,8 @@ gst_base_sink_change_state (GstElement * element) /* if we don't have a preroll buffer and we have not received EOS, * we need to wait for a preroll */ + GST_DEBUG ("have_preroll: %d, EOS: %d", basesink->have_preroll, + basesink->eos); if (!basesink->have_preroll && !basesink->eos) { basesink->need_preroll = TRUE; ret = GST_STATE_ASYNC; diff --git a/gst/gstclock.h b/gst/gstclock.h index c594fbb855..5438938154 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -130,7 +130,7 @@ typedef enum #define GST_CLOCK_COND(clock) (GST_CLOCK_CAST(clock)->entries_changed) #define GST_CLOCK_WAIT(clock) g_cond_wait(GST_CLOCK_COND(clock),GST_GET_LOCK(clock)) #define GST_CLOCK_TIMED_WAIT(clock,tv) g_cond_timed_wait(GST_CLOCK_COND(clock),GST_GET_LOCK(clock),tv) -#define GST_CLOCK_SIGNAL(clock) g_cond_broadcast(GST_CLOCK_COND(clock)) +#define GST_CLOCK_BROADCAST(clock) g_cond_broadcast(GST_CLOCK_COND(clock)) struct _GstClock { GstObject object; diff --git a/gst/gstobject.h b/gst/gstobject.h index fbbd916624..f466a2918b 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -63,9 +63,9 @@ typedef enum /* we do a GST_OBJECT_CAST to avoid type checking, better call these * function with a valid object! */ -#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT_CAST(obj)->lock)) -#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CAST(obj)->lock)) -#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CAST(obj)->lock)) +#define GST_LOCK(obj) g_mutex_lock(GST_OBJECT_CAST(obj)->lock) +#define GST_TRYLOCK(obj) g_mutex_trylock(GST_OBJECT_CAST(obj)->lock) +#define GST_UNLOCK(obj) g_mutex_unlock(GST_OBJECT_CAST(obj)->lock) #define GST_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock) #define GST_OBJECT_NAME(obj) (GST_OBJECT_CAST(obj)->name) diff --git a/gst/gstpad.c b/gst/gstpad.c index 7401c838a3..1b1c7a901c 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1833,7 +1833,7 @@ gst_pad_set_caps (GstPad * pad, GstCaps * caps) setcaps = GST_PAD_SETCAPSFUNC (pad); /* call setcaps function to configure the pad */ - if (setcaps != NULL) { + if (setcaps != NULL && caps) { if (!GST_PAD_IS_IN_SETCAPS (pad)) { GST_FLAG_SET (pad, GST_PAD_IN_SETCAPS); GST_UNLOCK (pad); diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index 5c67a92ff8..7c51d63e70 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -152,7 +152,7 @@ gst_system_clock_dispose (GObject * object) } g_list_free (clock->entries); clock->entries = NULL; - GST_CLOCK_SIGNAL (clock); + GST_CLOCK_BROADCAST (clock); GST_UNLOCK (clock); if (sysclock->thread) @@ -227,7 +227,7 @@ gst_system_clock_async_thread (GstClock * clock) GST_CAT_DEBUG (GST_CAT_CLOCK, "enter system clock thread"); GST_LOCK (clock); /* signal spinup */ - GST_CLOCK_SIGNAL (clock); + GST_CLOCK_BROADCAST (clock); /* now enter our infinite loop */ while (!sysclock->stopping) { GstClockEntry *entry; @@ -301,7 +301,7 @@ gst_system_clock_async_thread (GstClock * clock) } exit: /* signal exit */ - GST_CLOCK_SIGNAL (clock); + GST_CLOCK_BROADCAST (clock); GST_UNLOCK (clock); GST_CAT_DEBUG (GST_CAT_CLOCK, "exit system clock thread"); } @@ -424,7 +424,7 @@ gst_system_clock_id_wait_async (GstClock * clock, GstClockEntry * entry) * will get to this entry automatically. */ if (clock->entries->data == entry) { GST_CAT_DEBUG (GST_CAT_CLOCK, "send signal"); - GST_CLOCK_SIGNAL (clock); + GST_CLOCK_BROADCAST (clock); } GST_UNLOCK (clock); @@ -446,6 +446,6 @@ gst_system_clock_id_unschedule (GstClock * clock, GstClockEntry * entry) GST_LOCK (clock); entry->status = GST_CLOCK_UNSCHEDULED; GST_CAT_DEBUG (GST_CAT_CLOCK, "send signal"); - GST_CLOCK_SIGNAL (clock); + GST_CLOCK_BROADCAST (clock); GST_UNLOCK (clock); } diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index d7f53dcf91..be4c2bb36e 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -966,6 +966,8 @@ gst_base_sink_change_state (GstElement * element) /* if we don't have a preroll buffer and we have not received EOS, * we need to wait for a preroll */ + GST_DEBUG ("have_preroll: %d, EOS: %d", basesink->have_preroll, + basesink->eos); if (!basesink->have_preroll && !basesink->eos) { basesink->need_preroll = TRUE; ret = GST_STATE_ASYNC;