diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c index 62fab35eec..d8eb9e0a02 100644 --- a/gst-libs/gst/audio/gstaudiobasesink.c +++ b/gst-libs/gst/audio/gstaudiobasesink.c @@ -341,7 +341,7 @@ gst_audio_base_sink_dispose (GObject * object) sink->priv->custom_slaving_cb_notify (sink->priv->custom_slaving_cb_data); if (sink->provided_clock) { - gst_audio_clock_invalidate (sink->provided_clock); + gst_audio_clock_invalidate (GST_AUDIO_CLOCK (sink->provided_clock)); gst_object_unref (sink->provided_clock); sink->provided_clock = NULL; } @@ -1295,8 +1295,9 @@ gst_audio_base_sink_custom_slaving (GstAudioBaseSink * sink, /* sample clocks and figure out clock skew */ etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink)); - itime = gst_audio_clock_get_time (sink->provided_clock); - itime = gst_audio_clock_adjust (sink->provided_clock, itime); + itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock)); + itime = + gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime); GST_DEBUG_OBJECT (sink, "internal %" GST_TIME_FORMAT " external %" GST_TIME_FORMAT @@ -1442,8 +1443,9 @@ gst_audio_base_sink_skew_slaving (GstAudioBaseSink * sink, /* sample clocks and figure out clock skew */ etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink)); - itime = gst_audio_clock_get_time (sink->provided_clock); - itime = gst_audio_clock_adjust (sink->provided_clock, itime); + itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock)); + itime = + gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime); GST_DEBUG_OBJECT (sink, "internal %" GST_TIME_FORMAT " external %" GST_TIME_FORMAT @@ -1668,8 +1670,9 @@ gst_audio_base_sink_sync_latency (GstBaseSink * bsink, GstMiniObject * obj) /* We might need to take the object lock within gst_audio_clock_get_time(), * so call that before we take it again */ - itime = gst_audio_clock_get_time (sink->provided_clock); - itime = gst_audio_clock_adjust (sink->provided_clock, itime); + itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock)); + itime = + gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime); GST_OBJECT_LOCK (sink); diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index 1f0dc76a09..601d95c06b 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -272,7 +272,7 @@ gst_audio_base_src_dispose (GObject * object) GST_OBJECT_LOCK (src); if (src->clock) { - gst_audio_clock_invalidate (src->clock); + gst_audio_clock_invalidate (GST_AUDIO_CLOCK (src->clock)); gst_object_unref (src->clock); src->clock = NULL; } @@ -1027,7 +1027,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length, } else { /* to get the timestamp against the clock we also need to add our * offset */ - timestamp = gst_audio_clock_adjust (clock, timestamp); + timestamp = gst_audio_clock_adjust (GST_AUDIO_CLOCK (clock), timestamp); } /* we are not slaved, subtract base_time */ diff --git a/gst-libs/gst/audio/gstaudioclock.c b/gst-libs/gst/audio/gstaudioclock.c index edd9a329dc..4a6fd4b1a2 100644 --- a/gst-libs/gst/audio/gstaudioclock.c +++ b/gst-libs/gst/audio/gstaudioclock.c @@ -184,22 +184,19 @@ gst_audio_clock_get_internal_time (GstClock * clock) * Returns: the time as reported by the time function of the audio clock */ GstClockTime -gst_audio_clock_get_time (GstClock * clock) +gst_audio_clock_get_time (GstAudioClock * clock) { - GstAudioClock *aclock; GstClockTime result; - aclock = GST_AUDIO_CLOCK_CAST (clock); - - result = aclock->func (clock, aclock->user_data); + result = clock->func (GST_CLOCK_CAST (clock), clock->user_data); if (result == GST_CLOCK_TIME_NONE) { GST_DEBUG_OBJECT (clock, "no time, reuse last"); - result = aclock->last_time - aclock->time_offset; + result = clock->last_time - clock->time_offset; } GST_DEBUG_OBJECT (clock, "result %" GST_TIME_FORMAT ", last_time %" GST_TIME_FORMAT, - GST_TIME_ARGS (result), GST_TIME_ARGS (aclock->last_time)); + GST_TIME_ARGS (result), GST_TIME_ARGS (clock->last_time)); return result; } @@ -214,14 +211,11 @@ gst_audio_clock_get_time (GstClock * clock) * Returns: @time adjusted with the internal offset. */ GstClockTime -gst_audio_clock_adjust (GstClock * clock, GstClockTime time) +gst_audio_clock_adjust (GstAudioClock * clock, GstClockTime time) { - GstAudioClock *aclock; GstClockTime result; - aclock = GST_AUDIO_CLOCK_CAST (clock); - - result = time + aclock->time_offset; + result = time + clock->time_offset; return result; } @@ -238,11 +232,7 @@ gst_audio_clock_adjust (GstClock * clock, GstClockTime time) * the rest of its lifetime. */ void -gst_audio_clock_invalidate (GstClock * clock) +gst_audio_clock_invalidate (GstAudioClock * clock) { - GstAudioClock *aclock; - - aclock = GST_AUDIO_CLOCK_CAST (clock); - - aclock->func = gst_audio_clock_func_invalid; + clock->func = gst_audio_clock_func_invalid; } diff --git a/gst-libs/gst/audio/gstaudioclock.h b/gst-libs/gst/audio/gstaudioclock.h index 4956c9b796..9b8f51c575 100644 --- a/gst-libs/gst/audio/gstaudioclock.h +++ b/gst-libs/gst/audio/gstaudioclock.h @@ -94,10 +94,10 @@ GstClock* gst_audio_clock_new (const gchar *name, GstAudioCloc gpointer user_data, GDestroyNotify destroy_notify); void gst_audio_clock_reset (GstAudioClock *clock, GstClockTime time); -GstClockTime gst_audio_clock_get_time (GstClock * clock); -GstClockTime gst_audio_clock_adjust (GstClock * clock, GstClockTime time); +GstClockTime gst_audio_clock_get_time (GstAudioClock * clock); +GstClockTime gst_audio_clock_adjust (GstAudioClock * clock, GstClockTime time); -void gst_audio_clock_invalidate (GstClock * clock); +void gst_audio_clock_invalidate (GstAudioClock * clock); #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioClock, gst_object_unref)