From: David S. <dsc...@us...> - 2003-12-02 04:01:39
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: dschleef Date: Mon Dec 01 2003 20:01:38 PST Log message: Add GST_FORMAT_PERCENT. From ga...@go..., #125414. Modified files: ext/gnomevfs : gstgnomevfssrc.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/gnomevfs/gstgnomevfssrc.c.diff?r1=1.41&r2=1.42 ====Begin Diffs==== Index: gstgnomevfssrc.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/gnomevfs/gstgnomevfssrc.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- gstgnomevfssrc.c 31 Oct 2003 20:03:25 -0000 1.41 +++ gstgnomevfssrc.c 2 Dec 2003 04:01:24 -0000 1.42 @@ -1169,10 +1169,18 @@ *value = src->size; break; case GST_QUERY_POSITION: - if (*format != GST_FORMAT_BYTES) { - return FALSE; + switch (*format) { + case GST_FORMAT_BYTES: + *value = src->curoffset; + break; + case GST_FORMAT_PERCENT: + if (src->size == 0) + return FALSE; + *value = src->curoffset * GST_FORMAT_PERCENT_MAX / src->size; + break; + default: + return FALSE; } - *value = src->curoffset; break; default: return FALSE; |