mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
Add GST_FORMAT_PERCENT. From galt@gothpoodle.com, #125414.
Original commit message from CVS: Add GST_FORMAT_PERCENT. From galt@gothpoodle.com, #125414.
This commit is contained in:
parent
bbeb3eeca2
commit
473fd2f5e2
1 changed files with 11 additions and 3 deletions
|
@ -1169,10 +1169,18 @@ gst_gnomevfssrc_srcpad_query (GstPad *pad, GstQueryType type,
|
||||||
*value = src->size;
|
*value = src->size;
|
||||||
break;
|
break;
|
||||||
case GST_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
if (*format != GST_FORMAT_BYTES) {
|
switch (*format) {
|
||||||
return FALSE;
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue