+2005-12-07 Wim Taymans <wim@fluendo.com>
+
+ * gst/gstbuffer.c:
+ Small docs update.
+
+ * gst/gstcaps.c: (gst_caps_is_equal):
+ Don't assert on NULL <--> X. Fixes #323260
+
+ * gst/gstminiobject.c: (gst_mini_object_replace):
+ If we're doing atomic operations, we might just as well use
+ the proper way to get an atomic pointer.
+
+ * libs/gst/base/gstbasesink.c: (gst_base_sink_get_position):
+ Clean up debugging.
+
2005-12-07 Michael Smith <msmith@fluendo.com>
* gst/parse/grammar.y:
* Gets the media type of the buffer. This can be NULL if there
* is no media type attached to this buffer.
*
- * Returns: a reference to the #GstCaps.
+ * Returns: a reference to the #GstCaps. unref after usage.
* Returns NULL if there were no caps on this buffer.
*/
/* FIXME can we make this threadsafe without a lock on the buffer?
if (caps1 == caps2)
return TRUE;
- g_return_val_if_fail (caps1 != NULL, FALSE);
- g_return_val_if_fail (caps2 != NULL, FALSE);
+ /* one of them NULL => they are different (can't be both NULL because
+ * we checked that above) */
+ if (caps1 == NULL || caps2 == NULL)
+ return FALSE;
if (gst_caps_is_fixed (caps1) && gst_caps_is_fixed (caps2))
return gst_caps_is_equal_fixed (caps1, caps2);
{
GstMiniObject *olddata_val;
- if (newdata) {
+ if (newdata)
gst_mini_object_ref (newdata);
- }
do {
- olddata_val = *olddata;
+ olddata_val = g_atomic_pointer_get ((gpointer *) olddata);
} while (!g_atomic_pointer_compare_and_exchange ((gpointer *) olddata,
olddata_val, newdata));
- if (olddata_val) {
+ if (olddata_val)
gst_mini_object_unref (olddata_val);
- }
}
static void
/* we can answer time format */
GST_OBJECT_LOCK (basesink);
if ((clock = GST_ELEMENT_CLOCK (basesink))) {
- GstClockTime now;
+ GstClockTime now, base;
gint64 time;
gst_object_ref (clock);
else
time = 0;
- *cur = now - GST_ELEMENT_CAST (basesink)->base_time -
- basesink->segment.accum + time;
+ base = GST_ELEMENT_CAST (basesink)->base_time;
+ *cur = now - base - basesink->segment.accum + time;
GST_DEBUG_OBJECT (basesink,
- "now %" GST_TIME_FORMAT " + segment_time %" GST_TIME_FORMAT " = %"
- GST_TIME_FORMAT, GST_TIME_ARGS (now),
- GST_TIME_ARGS (time), GST_TIME_ARGS (*cur));
+ "now %" GST_TIME_FORMAT " - base %" GST_TIME_FORMAT " - accum %"
+ GST_TIME_FORMAT " + time %" GST_TIME_FORMAT " = %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (now), GST_TIME_ARGS (base),
+ GST_TIME_ARGS (basesink->segment.accum), GST_TIME_ARGS (time),
+ GST_TIME_ARGS (*cur));
gst_object_unref (clock);