mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
gst/gstutils.c: Small cleanup.
Original commit message from CVS: * gst/gstutils.c: (gst_util_uint64_scale_int64), (gst_util_uint64_scale_int): Small cleanup. * libs/gst/base/gstbasesink.c: (gst_base_sink_handle_object): Add debug log line. * libs/gst/base/gstbasetransform.c: (gst_base_transform_event): Add FIXME.
This commit is contained in:
parent
45fce73f08
commit
db2b4d916c
4 changed files with 31 additions and 18 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2005-12-02 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/gstutils.c: (gst_util_uint64_scale_int64),
|
||||
(gst_util_uint64_scale_int):
|
||||
Small cleanup.
|
||||
|
||||
* libs/gst/base/gstbasesink.c: (gst_base_sink_handle_object):
|
||||
Add debug log line.
|
||||
|
||||
* libs/gst/base/gstbasetransform.c: (gst_base_transform_event):
|
||||
Add FIXME.
|
||||
|
||||
2005-12-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* win32/MANIFEST:
|
||||
|
|
|
@ -428,12 +428,11 @@ static guint64
|
|||
gst_util_uint64_scale_int64 (guint64 val, guint64 num, guint64 denom)
|
||||
{
|
||||
GstUInt64 a0, a1, b0, b1, c0, ct, c1, result;
|
||||
GstUInt64 v, n, d;
|
||||
GstUInt64 v, n;
|
||||
|
||||
/* prepare input */
|
||||
v.ll = val;
|
||||
n.ll = num;
|
||||
d.ll = denom;
|
||||
|
||||
/* do 128 bits multiply
|
||||
* nh nl
|
||||
|
@ -551,6 +550,7 @@ guint64
|
|||
gst_util_uint64_scale_int (guint64 val, gint num, gint denom)
|
||||
{
|
||||
GstUInt64 result;
|
||||
GstUInt64 low, high;
|
||||
|
||||
g_return_val_if_fail (denom > 0, G_MAXUINT64);
|
||||
g_return_val_if_fail (num >= 0, G_MAXUINT64);
|
||||
|
@ -561,27 +561,25 @@ gst_util_uint64_scale_int (guint64 val, gint num, gint denom)
|
|||
if (num == 1 && denom == 1)
|
||||
return val;
|
||||
|
||||
if (val <= G_MAXUINT32) {
|
||||
if (val <= G_MAXUINT32)
|
||||
/* simple case */
|
||||
result.ll = val * num / denom;
|
||||
} else {
|
||||
GstUInt64 low, high;
|
||||
return val * num / denom;
|
||||
|
||||
/* do 96 bits mult/div */
|
||||
low.ll = val;
|
||||
result.ll = ((guint64) low.l.low) * num;
|
||||
high.ll = ((guint64) low.l.high) * num + (result.l.high);
|
||||
/* do 96 bits mult/div */
|
||||
low.ll = val;
|
||||
result.ll = ((guint64) low.l.low) * num;
|
||||
high.ll = ((guint64) low.l.high) * num + (result.l.high);
|
||||
|
||||
low.ll = high.ll / denom;
|
||||
result.l.high = high.ll % denom;
|
||||
result.ll /= denom;
|
||||
low.ll = high.ll / denom;
|
||||
result.l.high = high.ll % denom;
|
||||
result.ll /= denom;
|
||||
|
||||
/* avoid overflow */
|
||||
if (low.ll + result.l.high > G_MAXUINT32)
|
||||
goto overflow;
|
||||
/* avoid overflow */
|
||||
if (low.ll + result.l.high > G_MAXUINT32)
|
||||
goto overflow;
|
||||
|
||||
result.l.high += low.l.low;
|
||||
|
||||
result.l.high += low.l.low;
|
||||
}
|
||||
return result.ll;
|
||||
|
||||
overflow:
|
||||
|
|
|
@ -722,6 +722,7 @@ dropping:
|
|||
{
|
||||
GstBuffer *buf;
|
||||
|
||||
GST_DEBUG_OBJECT (basesink, "dropping buffer");
|
||||
buf = GST_BUFFER (g_queue_pop_tail (basesink->preroll_queue));
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
|
|
|
@ -1060,6 +1060,8 @@ gst_base_transform_event (GstPad * pad, GstEvent * event)
|
|||
if (bclass->event)
|
||||
ret = bclass->event (trans, event);
|
||||
|
||||
/* FIXME, do this in the default event handler so the subclass can do
|
||||
* something different. */
|
||||
if (ret)
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
|
||||
|
|
Loading…
Reference in a new issue