Add GST_FORMAT_PERCENT. From galt@gothpoodle.com, .

Original commit message from CVS:
Add GST_FORMAT_PERCENT.  From galt@gothpoodle.com, .
This commit is contained in:
David Schleef 2003-12-02 04:01:24 +00:00
parent bbeb3eeca2
commit 473fd2f5e2

View file

@ -1169,10 +1169,18 @@ gst_gnomevfssrc_srcpad_query (GstPad *pad, GstQueryType type,
*value = src->size;
break;
case GST_QUERY_POSITION:
if (*format != GST_FORMAT_BYTES) {
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;