Commit 04a38508 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

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
parent 8817d3e1
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:
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment