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 654278 - aiffmux creates broken files if data larger 2GB
aiffmux creates broken files if data larger 2GB
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other Linux
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-08 21:52 UTC by j^
Modified: 2011-08-16 22:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
aiffmux: avoid integer overflow (1.04 KB, patch)
2011-08-16 09:30 UTC, Vincent Penquerc'h
committed Details | Review
aiffmux: use guint32 for guint32 parameters (1.96 KB, patch)
2011-08-16 09:30 UTC, Vincent Penquerc'h
committed Details | Review
aiffmux: drop data after 4ish GB and moan (1.91 KB, patch)
2011-08-16 09:30 UTC, Vincent Penquerc'h
committed Details | Review

Description j^ 2011-07-08 21:52:02 UTC
aiffmux does not write files larger than 2GB properly.
saving a file larger than 2GB with this pipeline
 gst-launch-0.10 pulsesrc ! queue ! audio/x-raw-int,rate=44100,channels=2,width=32,depth=32 ! aiffmux ! filesink location=test.aiff

the resulting file will only play the first 1h40m in totem or audacity.
Comment 1 David Schleef 2011-07-09 23:28:16 UTC
Then don't use formats with 32-bit limits.  :)

AIFF can support 4 GB, so I suppose this is really a bug.  aiffmux could be helpful and generate an error after pushing 4 GB of data.
Comment 2 Vincent Penquerc'h 2011-08-16 09:29:55 UTC
Oddly, it worked fine for me, though using a slightly different pipeline (to avoid waiting 1h40):

gst-launch audiotestsrc is-live=0 blocksize=$((1024*1024)) num-buffers=3096 ! audioconvert ! audio/x-raw-int,rate=44100,channels=2,width=32,depth=32 ! aiffmux ! filesink location=test.aiff

Audacity and Totem saw the whole file of about 3 GB. There was an integer overflow though, but which would have triggered at about half a GB's size, so probably not the cause.

Not sure whether it's better to drop data after 4 GB or cause a pipeline flow error though. I've done the former.

Patches to folllow...
Comment 3 Vincent Penquerc'h 2011-08-16 09:30:30 UTC
Created attachment 193922 [details] [review]
aiffmux: avoid integer overflow

These values are 32 bits, and width is a multiple of 8.
Comment 4 Vincent Penquerc'h 2011-08-16 09:30:40 UTC
Created attachment 193923 [details] [review]
aiffmux: use guint32 for guint32 parameters

This makes explicit that the range is limited.
Comment 5 Vincent Penquerc'h 2011-08-16 09:30:47 UTC
Created attachment 193924 [details] [review]
aiffmux: drop data after 4ish GB and moan
Comment 6 Mark Nauwelaerts 2011-08-16 09:32:55 UTC
Maybe also return GST_FLOW_UNEXPECTED which could persuade upstream to conduct end-of-file stuff ?
Comment 7 Vincent Penquerc'h 2011-08-16 11:33:29 UTC
That's what I meant by "caus[ing] a pipeline flow error".
Thing is, I'm not sure if this could cause some data to be lost a bit below the 4 GB size (eg, waiting in a queue, or something), rather than just the data above 4 GB.
Comment 8 Tim-Philipp Müller 2011-08-16 22:34:49 UTC
Comment on attachment 193924 [details] [review]
aiffmux: drop data after 4ish GB and moan

Rewrote this a little (didn't like the if over two lines with casts etc.), hope I didn't mess anything up.
Comment 9 Tim-Philipp Müller 2011-08-16 22:37:20 UTC
Not sure returning GST_FLOW_UNEXPECTED is a good idea, this may cause unnecessary data loss in other parts of the pipeline.

I'm almost wondering if it wouldn't be best to just continue pushing out the data (so it gets written into the output file if possible), but just make the data size in the header ~4GB.