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 687927 - xingmux: doesn't compute the right number of frames
xingmux: doesn't compute the right number of frames
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
0.10.19
Other Linux
: Normal normal
: 1.0.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-08 15:22 UTC by Gautier Portet
Modified: 2012-11-16 23:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.00 KB, patch)
2012-11-08 15:22 UTC, Gautier Portet
committed Details | Review

Description Gautier Portet 2012-11-08 15:22:19 UTC
Created attachment 228479 [details] [review]
patch

As reported here: https://bugs.launchpad.net/soundconverter/+bug/1075497
The xing header frames count in mp3 generated with gstreamer's xingmux always have two frames missing.

After a verification of the xingmux code, I propose a small fix:

First, the xing header frame is never added to the count, we have to increment the count.
Secondly, there is a rounding error when calculating the frame duration, as spf*GST_SECOND/rate is not an integer (26122448.9) an it must be 26122449.
Comment 1 Sebastian Dröge (slomo) 2012-11-09 10:35:48 UTC
commit cf3e901996ab885d2556029564f956c9bca75a2e
Author: Gautier Portet <kassoulet@gmail.com>
Date:   Fri Nov 9 11:33:40 2012 +0100

    xingmux: Properly calculate the number of frames
    
    First, the xing header frame is never added to the count,
    we have to increment the count.
    Secondly, there is a rounding error when calculating the
    frame duration, as spf*GST_SECOND/rate is not an integer
    (26122448.9) an it must be 26122449.
Comment 2 Tim-Philipp Müller 2012-11-15 15:33:54 UTC
Looks like this made the unit test unhappy:

 elements/xingmux.c:125:F:general:test_xing_remux:0: Assertion 'memcmp (test_xing, map.data, map.size) == 0' failed
Comment 3 Tim-Philipp Müller 2012-11-16 23:44:20 UTC
commit 2b3b7ea810a16c76427451d7d76ba5b4fc6e8dd4
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Fri Nov 16 13:32:00 2012 +0100

    xingmux: Fix unit test after change to correctly calculate number of frames