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 657904 - audio conversion error from 32bits float to 16bit int
audio conversion error from 32bits float to 16bit int
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.35
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-01 08:55 UTC by fan.su
Modified: 2011-12-07 21:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description fan.su 2011-09-01 08:55:22 UTC
In function orc_audio_convert_unpack_float_s32 of gst-plugins-base/gst/audioconvert/gstaudioconvertorc-dist.c, current source code as following:

    /* 5: convfl */
    {
      int tmp;
      tmp = (int) var38.f;            // wrong!!!
      if (tmp == 0x80000000 && !(var38.i & 0x80000000))
        tmp = 0x7fffffff;
      var35.i = tmp;
    }

If var38.f is in float and it may be out of 32bit integer's range. So it's unexpected to cast float to integer.

In my case, var38.f is -2179590144.000000 and tmp is 7FFFFFFF after that wrong line was executed. Obviously, it doesn't make sense that a negative value was converted to a positive value. I think we should clamp var38.f in 32bit integer's range before type cast.

BTW, so much unreasonable type casts as above were in this file.
Comment 1 David Schleef 2011-09-01 21:34:53 UTC
Please paste or attach the output of orc-bugreport.
Comment 2 fan.su 2011-09-02 02:32:47 UTC
What is the output of orc-bugreport, my debug info or else?

If else, please tell me how to retrieve it.

My debug info:

:: enter orc_audio_convert_unpack_float_s32
:: loadl
:: var36.i = bf81e9e8
:: mulf
:: _dest1.f = -2179590144.000000
:: var37.i = cf01e9e8
:: addf
:: _dest1.f = -2179590144.000000
:: var38.i = cf01e9e8
:: convfl
:: var38.f = -2179590144.000000
:: tmp = 7fffffff
:: var35.i = 7fffffff

From above info, 0xbf81e9e8 is unpacked to 0x7FFFFFFF.
Comment 3 David Schleef 2011-09-02 06:15:20 UTC
(In reply to comment #2)
> If else, please tell me how to retrieve it.

You run orc-bugreport.
Comment 4 Akhil Laddha 2011-10-21 05:57:37 UTC
fan.su, ping, can you please provide the requested information ?
Comment 5 Fabio Durán Verdugo 2011-12-07 21:42:05 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!