mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +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;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue