mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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:
parent
8817d3e16a
commit
04a38508e1
5 changed files with 16 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue