After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753881 - hls/m3u8: make check fails for hlsdemux_m3u8 due to floating point rounding error
hls/m3u8: make check fails for hlsdemux_m3u8 due to floating point rounding e...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 751766 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-08-20 14:06 UTC by A Ashley
Modified: 2015-08-28 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check: hlsdemux: make duration unit test robust to floating point rounding (1.81 KB, patch)
2015-08-20 14:09 UTC, A Ashley
committed Details | Review

Description A Ashley 2015-08-20 14:06:07 UTC
The test_playlist_with_doubles_duration() test fails on some platforms due to rounding errors that occur when m3u8.c converts from the floating point value in the HLS manifest to a GstClockTime.

make check failing for gst-plugins-bad has finally annoyed me enough times to actually have a go at fixing the problem!
Comment 1 A Ashley 2015-08-20 14:09:34 UTC
Created attachment 309726 [details] [review]
check: hlsdemux: make duration unit test robust to floating point rounding

Using assert_equals_float() fixes the check failing because it handles the rounding error issues by accepting almost equal.
Comment 2 Sebastian Dröge (slomo) 2015-08-20 14:14:05 UTC
commit 48fefd8c841c6b22a620d3b6d6af5d062886627f
Author: Alex Ashley <bugzilla@ashley-family.net>
Date:   Thu Aug 20 15:00:02 2015 +0100

    check: hlsdemux: make duration unit test robust to floating point rounding
    
    The test_playlist_with_doubles_duration() test fails on some platforms
    due to rounding errors that occur when m3u8.c converts from the floating
    point value in the HLS manifest to a GstClockTime.
    
    Using assert_equals_float() fixes this because this function handles
    the rounding error issues by accepting almost equal.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753881
Comment 3 Tim-Philipp Müller 2015-08-20 14:15:47 UTC
Same as bug #751766 fwiw.
Comment 4 Sebastian Dröge (slomo) 2015-08-20 14:23:06 UTC
*** Bug 751766 has been marked as a duplicate of this bug. ***
Comment 5 Vineeth 2015-08-20 23:52:59 UTC
This patch does fix the test failure.
But this fix seems to be more of a cover up of the issue right?
I mean the actual code still has rounding errors and applications which try to use this will still face the issue. Though it is not a major issue to worry about i guess :)...
But as i mentioned in the other bug, this seems to be more of a glib issue(g_ascii_strtod)
The rounding off also seems to be random(maybe some specific, but could not deduce). For some values it works fine and for some it does not.