mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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:
parent
c3fecfa6f8
commit
0e3178c111
3 changed files with 15 additions and 8 deletions
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue