wavparse: do not truncate files >2GB
The wavparse element is truncating wav files over 2GB. Here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/blob/master/gst/wavparse/gstwavparse.c#L1308
The maximum size of a RIFF chunk is a 32 bits unsigned integer, so 4GB. (https://en.wikipedia.org/wiki/Resource_Interchange_File_Format#Explanation)
When converting a 3.7GB wav file, the stream is truncated, and the resulting length is wrong. But we don't get an error there.
gst-launch-1.0 --gst-debug-level=2 giosrc location="file:///home/gautier/tmp/soundconverter/mixdown2_session.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=7 ! xingmux ! id3mux ! giosink location="file:///home/gautier/tmp/soundconverter/converted-32f.mp3"
In the gst log:
gstwavparse.c:1663:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk PEAK
gstwavparse.c:1307:gst_wavparse_stream_headers:<wavparse0> Invalid size, clipping to 0x7fffffff
gstwavparse.c:1307:gst_wavparse_stream_headers:<wavparse0> Invalid size, clipping to 0x7fffffff
gstwavparse.c:1313:gst_wavparse_stream_headers:<wavparse0> Clipping chunk size to file size
gstwavparse.c:1663:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk .../
$ soxi mixdown2_session.wav converted-32f.mp3
Input File : 'mixdown2_session.wav'
Duration : 02:42:22.21 = 467625983 samples ~ 730666 CDDA sectors
File Size : 3.74G
Sample Encoding: 32-bit Floating Point PCM
Input File : 'converted-32f.mp3'
Duration : 01:33:12.49 = 178959744 samples ~ 419437 CDDA sectors
File Size : 66.2M
Sample Encoding: MPEG audio (layer I, II or III)
Downstream issue: https://bugs.launchpad.net/soundconverter/+bug/1878083