Commit 1e9f5c82 authored by Julien Moutte's avatar Julien Moutte

ext/gnomevfs/gstgnomevfssrc.c: Fixing seeking emiting FLUSH and even before DISCONT.

Original commit message from CVS:
2004-01-29  Julien MOUTTE  <julien@moutte.net>

* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking
emiting FLUSH and even before DISCONT.
* gst-libs/gst/play/gstplay.c: (gst_play_seek_to_time): Fix seeking to
get the best instant seeking as possible yay!
parent 893a0e1a
2004-01-29 Julien MOUTTE <julien@moutte.net>
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking
emiting FLUSH and even before DISCONT.
* gst-libs/gst/play/gstplay.c: (gst_play_seek_to_time): Fix seeking to
get the best instant seeking as possible yay!
2004-01-29 Ronald Bultje <rbultje@ronald.bitfreak.net>
* gst/mpeg1videoparse/gstmp1videoparse.c:
......
......@@ -986,20 +986,23 @@ static GstData *gst_gnomevfssrc_get(GstPad *pad)
GST_BUFFER_DATA(buf) = g_malloc(src->bytes_per_read);
g_return_val_if_fail(GST_BUFFER_DATA(buf) != NULL, NULL);
if (src->new_seek)
{
GstEvent *event;
gst_buffer_unref (buf);
GST_DEBUG ("new seek %" G_GINT64_FORMAT, src->curoffset);
src->new_seek = FALSE;
GST_DEBUG ("gnomevfssrc sending discont");
event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
src->need_flush = FALSE;
return GST_DATA (event);
}
if (src->need_flush) {
GstEvent *event = gst_event_new_flush ();
src->need_flush = FALSE;
gst_buffer_unref (buf);
GST_DEBUG ("gnomevfssrc sending flush");
return GST_DATA (event);
}
if (src->new_seek) {
GstEvent *event;
gst_buffer_unref (buf);
GST_DEBUG ("new seek %" G_GINT64_FORMAT, src->curoffset);
src->new_seek = FALSE;
GST_DEBUG ("gnomevfssrc sending discont");
event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
return GST_DATA (event);
}
result = gnome_vfs_read(src->handle, GST_BUFFER_DATA(buf),
src->bytes_per_read, &readbytes);
......
......@@ -624,7 +624,7 @@ gst_play_get_location (GstPlay *play)
gboolean
gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
{
GstElement *audio_sink_element, *video_sink_element;
GstElement *audio_seek_element, *video_seek_element, *audio_sink_element;
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
......@@ -632,20 +632,23 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
if (time_nanos < 0LL)
time_nanos = 0LL;
audio_seek_element = g_hash_table_lookup (play->priv->elements,
"audioconvert");
audio_sink_element = g_hash_table_lookup (play->priv->elements,
"audio_sink_element");
video_sink_element = g_hash_table_lookup (play->priv->elements,
"video_sink_element");
video_seek_element = g_hash_table_lookup (play->priv->elements,
"identity");
if (GST_IS_ELEMENT (audio_sink_element) &&
GST_IS_ELEMENT (video_sink_element)) {
if (GST_IS_ELEMENT (audio_seek_element) &&
GST_IS_ELEMENT (video_seek_element) &&
GST_IS_ELEMENT (audio_sink_element)) {
gboolean s = FALSE;
s = gst_element_seek (video_sink_element, GST_FORMAT_TIME |
s = gst_element_seek (video_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
if (!s) {
s = gst_element_seek (audio_sink_element, GST_FORMAT_TIME |
s = gst_element_seek (audio_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
}
......
......@@ -624,7 +624,7 @@ gst_play_get_location (GstPlay *play)
gboolean
gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
{
GstElement *audio_sink_element, *video_sink_element;
GstElement *audio_seek_element, *video_seek_element, *audio_sink_element;
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
......@@ -632,20 +632,23 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
if (time_nanos < 0LL)
time_nanos = 0LL;
audio_seek_element = g_hash_table_lookup (play->priv->elements,
"audioconvert");
audio_sink_element = g_hash_table_lookup (play->priv->elements,
"audio_sink_element");
video_sink_element = g_hash_table_lookup (play->priv->elements,
"video_sink_element");
video_seek_element = g_hash_table_lookup (play->priv->elements,
"identity");
if (GST_IS_ELEMENT (audio_sink_element) &&
GST_IS_ELEMENT (video_sink_element)) {
if (GST_IS_ELEMENT (audio_seek_element) &&
GST_IS_ELEMENT (video_seek_element) &&
GST_IS_ELEMENT (audio_sink_element)) {
gboolean s = FALSE;
s = gst_element_seek (video_sink_element, GST_FORMAT_TIME |
s = gst_element_seek (video_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
if (!s) {
s = gst_element_seek (audio_sink_element, GST_FORMAT_TIME |
s = gst_element_seek (audio_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment