From 11c4fea0c83af637f86ef668b0778fc2583da4d5 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 14 Jan 2004 02:37:12 +0000 Subject: [PATCH] gst-libs/gst/play/gstplay.c: Query the audio element to get the time, not the clock. We're interested in the element'... Original commit message from CVS: 2004-01-14 Benjamin Otte * gst-libs/gst/play/gstplay.c: (gst_play_tick_callback): Query the audio element to get the time, not the clock. We're interested in the element's time here. --- ChangeLog | 6 ++++++ gst-libs/gst/play/gstplay.c | 9 ++++++--- gst-libs/gst/play/play.c | 9 ++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c8bbb4501..9437b0a042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-01-14 Benjamin Otte + + * gst-libs/gst/play/gstplay.c: (gst_play_tick_callback): + Query the audio element to get the time, not the clock. We're + interested in the element's time here. + 2004-01-14 Benjamin Otte * ext/aalib/gstaasink.c: (gst_aasink_chain): diff --git a/gst-libs/gst/play/gstplay.c b/gst-libs/gst/play/gstplay.c index dee3f8ef99..69f6f18753 100644 --- a/gst-libs/gst/play/gstplay.c +++ b/gst-libs/gst/play/gstplay.c @@ -262,7 +262,8 @@ gst_play_have_video_size (GstElement *element, gint width, static gboolean gst_play_tick_callback (GstPlay *play) { - GstClock *clock = NULL; + GstElement* audio_sink_element; + GstClockTime time; g_return_val_if_fail (play != NULL, FALSE); @@ -271,8 +272,10 @@ gst_play_tick_callback (GstPlay *play) return FALSE; } - clock = gst_bin_get_clock (GST_BIN (play)); - play->priv->time_nanos = gst_clock_get_time (clock); + audio_sink_element = g_hash_table_lookup (play->priv->elements, + "audio_sink_element"); + time = gst_element_get_time (audio_sink_element); + play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0; g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK], 0,play->priv->time_nanos); diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c index dee3f8ef99..69f6f18753 100644 --- a/gst-libs/gst/play/play.c +++ b/gst-libs/gst/play/play.c @@ -262,7 +262,8 @@ gst_play_have_video_size (GstElement *element, gint width, static gboolean gst_play_tick_callback (GstPlay *play) { - GstClock *clock = NULL; + GstElement* audio_sink_element; + GstClockTime time; g_return_val_if_fail (play != NULL, FALSE); @@ -271,8 +272,10 @@ gst_play_tick_callback (GstPlay *play) return FALSE; } - clock = gst_bin_get_clock (GST_BIN (play)); - play->priv->time_nanos = gst_clock_get_time (clock); + audio_sink_element = g_hash_table_lookup (play->priv->elements, + "audio_sink_element"); + time = gst_element_get_time (audio_sink_element); + play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0; g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK], 0,play->priv->time_nanos);