gst/base/gstbasesrc.c (gst_base_src_query): Clean up percent position reporting.

Original commit message from CVS:
2005-10-21  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasesrc.c (gst_base_src_query): Clean up percent
position reporting.
This commit is contained in:
Andy Wingo 2005-10-21 09:24:28 +00:00
parent c3fecfa6f8
commit 0e3178c111
3 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2005-10-21 Andy Wingo <wingo@pobox.com>
* gst/base/gstbasesrc.c (gst_base_src_query): Clean up percent
position reporting.
2005-10-20 Wim Taymans <wim@fluendo.com>
* gst/gsterror.c: (gst_error_get_message):

View file

@ -334,10 +334,11 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
return TRUE;
case GST_FORMAT_PERCENT:
b = gst_base_src_get_size (src, &ui64);
i64 = GST_FORMAT_PERCENT_MAX;
if (b)
i64 *= gst_guint64_to_gdouble (src->offset)
/ gst_guint64_to_gdouble (ui64);
if (b && src->offset > ui64)
i64 = gst_util_uint64_scale (GST_FORMAT_PERCENT_MAX, src->offset,
ui64);
else
i64 = GST_FORMAT_PERCENT_MAX;
gst_query_set_position (query, GST_FORMAT_PERCENT, i64);
return TRUE;
default:

View file

@ -334,10 +334,11 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
return TRUE;
case GST_FORMAT_PERCENT:
b = gst_base_src_get_size (src, &ui64);
i64 = GST_FORMAT_PERCENT_MAX;
if (b)
i64 *= gst_guint64_to_gdouble (src->offset)
/ gst_guint64_to_gdouble (ui64);
if (b && src->offset > ui64)
i64 = gst_util_uint64_scale (GST_FORMAT_PERCENT_MAX, src->offset,
ui64);
else
i64 = GST_FORMAT_PERCENT_MAX;
gst_query_set_position (query, GST_FORMAT_PERCENT, i64);
return TRUE;
default: