diff options
author | Julien Moutte <julien@moutte.net> | 2004-01-29 22:44:42 +0000 |
---|---|---|
committer | Julien Moutte <julien@moutte.net> | 2004-01-29 22:44:42 +0000 |
commit | 1e9f5c82bec886896e6a0c4fc6d79de5649d9bb8 (patch) | |
tree | 2cd22acfd3c037599c6725dc3df983c871343a32 /ext | |
parent | 893a0e1aa781624eb0aab805fb99b6c0a1efd13f (diff) |
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!
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gnomevfs/gstgnomevfssrc.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index 00f605e26..0bd160f4a 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.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); |