gst/base/: fix more guint64<->gdouble conversions

Original commit message from CVS:

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/base/gstbasesrc.c: (gst_base_src_query):
fix more guint64<->gdouble conversions
This commit is contained in:
Thomas Vander Stichele 2005-10-12 21:56:52 +00:00
parent 8817d3e16a
commit 04a38508e1
5 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2005-10-12 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
* gst/base/gstbasesrc.c: (gst_base_src_query):
fix more guint64<->gdouble conversions
2005-10-12 Thomas Vander Stichele <thomas at apestaart dot org>
* Makefile.am:

View file

@ -524,7 +524,8 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
}
/* use previous rate to calculate duration */
basesink->segment_accum += (duration / ABS (basesink->segment_rate));
basesink->segment_accum += gst_gdouble_to_guint64 (
(gst_guint64_to_gdouble (duration) / ABS (basesink->segment_rate)));
/* then update the current segment */
basesink->segment_rate = rate;
basesink->segment_start = segment_start;

View file

@ -338,7 +338,9 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
case GST_FORMAT_PERCENT:
b = gst_base_src_get_size (src, &ui64);
i64 = GST_FORMAT_PERCENT_MAX;
i64 *= b ? (src->offset / gst_guint64_to_gdouble (ui64)) : 1.0;
if (b)
i64 *= gst_guint64_to_gdouble (src->offset)
/ gst_guint64_to_gdouble (ui64);
gst_query_set_position (query, GST_FORMAT_PERCENT,
i64, GST_FORMAT_PERCENT_MAX);
return TRUE;

View file

@ -524,7 +524,8 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
}
/* use previous rate to calculate duration */
basesink->segment_accum += (duration / ABS (basesink->segment_rate));
basesink->segment_accum += gst_gdouble_to_guint64 (
(gst_guint64_to_gdouble (duration) / ABS (basesink->segment_rate)));
/* then update the current segment */
basesink->segment_rate = rate;
basesink->segment_start = segment_start;

View file

@ -338,7 +338,9 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
case GST_FORMAT_PERCENT:
b = gst_base_src_get_size (src, &ui64);
i64 = GST_FORMAT_PERCENT_MAX;
i64 *= b ? (src->offset / gst_guint64_to_gdouble (ui64)) : 1.0;
if (b)
i64 *= gst_guint64_to_gdouble (src->offset)
/ gst_guint64_to_gdouble (ui64);
gst_query_set_position (query, GST_FORMAT_PERCENT,
i64, GST_FORMAT_PERCENT_MAX);
return TRUE;