gst/matroska/matroska-demux.c: Fix a bad conversion using gst_guint64_to_gdouble. fabs ((gdouble) demux->index[entry]...

Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroskademux_do_index_seek):
Fix a bad conversion using gst_guint64_to_gdouble.
fabs ((gdouble) demux->index[entry].time - (gdouble) seek_pos) can not be
replaced by fabs (gst_guint64_to_gdouble (demux->index[entry].time - seek_pos)) as the
difference could be negative. fabs (gst_guint64_to_gdouble (demux->index[entry].time) -
gst_guint64_to_gdouble (seek_pos)) is the good solution. Thanks to Tim who has seen my
mistake.
This commit is contained in:
Sébastien Moutte 2006-04-23 15:55:30 +00:00
parent b58a224cd1
commit 0ba1bac264
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2006-04-23 Sebastien Moutte <sebastien@moutte.net>
* gst/matroska/matroska-demux.c: (gst_matroskademux_do_index_seek):
Fix a bad conversion using gst_guint64_to_gdouble.
fabs ((gdouble) demux->index[entry].time - (gdouble) seek_pos) can not be
replaced by fabs (gst_guint64_to_gdouble (demux->index[entry].time - seek_pos)) as the
difference could be negative. fabs (gst_guint64_to_gdouble (demux->index[entry].time) -
gst_guint64_to_gdouble (seek_pos)) is the good solution. Thanks to Tim who has seen my
mistake.
2006-04-21 Sebastien Moutte <sebastien@moutte.net>
* gst/matroska/matroska-demux.c: (gst_matroskademux_do_index_seek):

View file

@ -1043,9 +1043,10 @@ gst_matroskademux_do_index_seek (GstMatroskaDemux * demux, gint64 seek_pos,
for (n = 0; n < demux->num_indexes; ++n) {
gdouble d_entry, d_this;
d_entry =
fabs (gst_guint64_to_gdouble (demux->index[entry].time - seek_pos));
d_this = fabs (gst_guint64_to_gdouble (demux->index[n].time - seek_pos));
d_entry = fabs (gst_guint64_to_gdouble (demux->index[entry].time) -
gst_guint64_to_gdouble (seek_pos));
d_this = fabs (gst_guint64_to_gdouble (demux->index[n].time) -
gst_guint64_to_gdouble (seek_pos));
if (d_this < d_entry &&
(demux->index[n].time < segment_stop || segment_stop == -1)) {