mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
gst-libs/gst/play/gstplay.c: Fixing the way to get current position.
Original commit message from CVS: 2004-01-27 Julien MOUTTE <julien@moutte.net> * gst-libs/gst/play/gstplay.c: (gst_play_tick_callback), (gst_play_seek_to_time): Fixing the way to get current position.
This commit is contained in:
parent
5a6674f100
commit
a7db4b6141
3 changed files with 51 additions and 22 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-01-27 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* gst-libs/gst/play/gstplay.c: (gst_play_tick_callback),
|
||||||
|
(gst_play_seek_to_time): Fixing the way to get current position.
|
||||||
|
|
||||||
2004-01-27 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
2004-01-27 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
* sys/oss/gstosssink.c: (gst_osssink_sink_query):
|
* sys/oss/gstosssink.c: (gst_osssink_sink_query):
|
||||||
|
|
|
@ -311,8 +311,9 @@ gst_play_have_video_size (GstElement *element, gint width,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_play_tick_callback (GstPlay *play)
|
gst_play_tick_callback (GstPlay *play)
|
||||||
{
|
{
|
||||||
GstElement* audio_sink_element;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
GstClockTime time;
|
gboolean q = FALSE;
|
||||||
|
GstElement *audio_sink_element = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (play != NULL, FALSE);
|
g_return_val_if_fail (play != NULL, FALSE);
|
||||||
|
|
||||||
|
@ -323,9 +324,16 @@ gst_play_tick_callback (GstPlay *play)
|
||||||
|
|
||||||
audio_sink_element = g_hash_table_lookup (play->priv->elements,
|
audio_sink_element = g_hash_table_lookup (play->priv->elements,
|
||||||
"audio_sink_element");
|
"audio_sink_element");
|
||||||
time = gst_element_get_time (audio_sink_element);
|
|
||||||
play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0;
|
|
||||||
|
|
||||||
|
if (!GST_IS_ELEMENT (audio_sink_element)) {
|
||||||
|
play->priv->tick_id = 0;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
q = gst_element_query (audio_sink_element, GST_QUERY_POSITION, &format,
|
||||||
|
&(play->priv->time_nanos));
|
||||||
|
|
||||||
|
if (q)
|
||||||
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
||||||
0,play->priv->time_nanos);
|
0,play->priv->time_nanos);
|
||||||
|
|
||||||
|
@ -643,9 +651,13 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
GstClockTime time;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
time = gst_element_get_time (audio_sink_element);
|
gboolean q = FALSE;
|
||||||
play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0;
|
|
||||||
|
q = gst_element_query (audio_sink_element, GST_QUERY_POSITION, &format,
|
||||||
|
&(play->priv->time_nanos));
|
||||||
|
|
||||||
|
if (q)
|
||||||
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
||||||
0,play->priv->time_nanos);
|
0,play->priv->time_nanos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,8 +311,9 @@ gst_play_have_video_size (GstElement *element, gint width,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_play_tick_callback (GstPlay *play)
|
gst_play_tick_callback (GstPlay *play)
|
||||||
{
|
{
|
||||||
GstElement* audio_sink_element;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
GstClockTime time;
|
gboolean q = FALSE;
|
||||||
|
GstElement *audio_sink_element = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (play != NULL, FALSE);
|
g_return_val_if_fail (play != NULL, FALSE);
|
||||||
|
|
||||||
|
@ -323,9 +324,16 @@ gst_play_tick_callback (GstPlay *play)
|
||||||
|
|
||||||
audio_sink_element = g_hash_table_lookup (play->priv->elements,
|
audio_sink_element = g_hash_table_lookup (play->priv->elements,
|
||||||
"audio_sink_element");
|
"audio_sink_element");
|
||||||
time = gst_element_get_time (audio_sink_element);
|
|
||||||
play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0;
|
|
||||||
|
|
||||||
|
if (!GST_IS_ELEMENT (audio_sink_element)) {
|
||||||
|
play->priv->tick_id = 0;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
q = gst_element_query (audio_sink_element, GST_QUERY_POSITION, &format,
|
||||||
|
&(play->priv->time_nanos));
|
||||||
|
|
||||||
|
if (q)
|
||||||
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
||||||
0,play->priv->time_nanos);
|
0,play->priv->time_nanos);
|
||||||
|
|
||||||
|
@ -643,9 +651,13 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
GstClockTime time;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
time = gst_element_get_time (audio_sink_element);
|
gboolean q = FALSE;
|
||||||
play->priv->time_nanos = GST_CLOCK_TIME_IS_VALID (time) ? time : 0;
|
|
||||||
|
q = gst_element_query (audio_sink_element, GST_QUERY_POSITION, &format,
|
||||||
|
&(play->priv->time_nanos));
|
||||||
|
|
||||||
|
if (q)
|
||||||
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK],
|
||||||
0,play->priv->time_nanos);
|
0,play->priv->time_nanos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue