From 803a00f9a66063adc14831ac76752e414bcd8151 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 2 Jun 2002 15:48:25 +0000 Subject: [PATCH] Better fallback for when seeking is not supported by the peer element. Original commit message from CVS: Better fallback for when seeking is not supported by the peer element. --- ext/vorbis/vorbisfile.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/vorbis/vorbisfile.c b/ext/vorbis/vorbisfile.c index 74183647e..e7a4badd0 100644 --- a/ext/vorbis/vorbisfile.c +++ b/ext/vorbis/vorbisfile.c @@ -444,7 +444,12 @@ gst_vorbisfile_loop (GstElement *element) } vorbisfile->may_eos = TRUE; - GST_BUFFER_TIMESTAMP (outbuf) = (gint64) (ov_time_tell (&vorbisfile->vf) * GST_SECOND); + if (vorbisfile->vf.seekable) { + GST_BUFFER_TIMESTAMP (outbuf) = (gint64) (ov_time_tell (&vorbisfile->vf) * GST_SECOND); + } + else { + GST_BUFFER_TIMESTAMP (outbuf) = 0; + } gst_pad_push (vorbisfile->srcpad, outbuf); } @@ -515,6 +520,9 @@ gst_vorbisfile_src_event (GstPad *pad, GstEvent *event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: + if (!vorbisfile->vf.seekable) + return FALSE; + switch (GST_EVENT_SEEK_FORMAT (event)) { case GST_FORMAT_TIME: vorbisfile->seek_pending = TRUE; -- GitLab