From: Wim T. <wt...@us...> - 2002-06-02 15:48:38
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: wtay Date: Sun Jun 02 2002 08:48:37 PDT Log message: Better fallback for when seeking is not supported by the peer element. Modified files: ext/vorbis : vorbisfile.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/vorbis/vorbisfile.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: vorbisfile.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/vorbis/vorbisfile.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vorbisfile.c 2 Jun 2002 11:57:12 -0000 1.2 +++ vorbisfile.c 2 Jun 2002 15:48:25 -0000 1.3 @@ -444,7 +444,12 @@ } 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 @@ 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; |