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 727402 - aiffmux: write padding byte at end of SSND chunk if needed
aiffmux: write padding byte at end of SSND chunk if needed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-31 18:18 UTC by Matthieu Bouron
Modified: 2015-01-23 15:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
aiffmux: write padding byte at end of SSND chunk if needed (2.30 KB, patch)
2014-03-31 18:22 UTC, Matthieu Bouron
needs-work Details | Review
aiffmux: write padding byte at end of SSND chunk if needed (2.49 KB, patch)
2015-01-23 14:11 UTC, Matthieu Bouron
committed Details | Review
aiffmux: write padding byte at end of SSND chunk if needed (2.51 KB, patch)
2015-01-23 15:13 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Matthieu Bouron 2014-03-31 18:18:52 UTC
Aligning the SSND chunk will let the aiff muxer properly write chunks (like the ID3 one) after it.

AIFF chunks are supposed to be even aligned.
Comment 1 Matthieu Bouron 2014-03-31 18:22:12 UTC
Created attachment 273357 [details] [review]
aiffmux: write padding byte at end of SSND chunk if needed
Comment 2 Sebastian Dröge (slomo) 2014-10-20 11:40:11 UTC
Review of attachment 273357 [details] [review]:

::: gst/aiff/aiffmux.c
@@ +141,3 @@
+  /* AIFF chunks must be even aligned */
+  cur_size = AIFF_HEADER_LEN - 8 + audio_data_size;
+  if (cur_size & 1 && ((cur_size + 1) < G_MAXUINT32)) {

No need for all these brackets, but I would make the & clearer

if ((cur_size & 1) && cur_size + 1 < G_MAXUINT32)

@@ +414,3 @@
+        GST_BUFFER_OFFSET (buffer) = AIFF_HEADER_LEN + aiffmux->length;
+        GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE;
+        gst_pad_push (aiffmux->srcpad, buffer);

Check the return value and print debug output here
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-23 13:46:21 UTC
Matthieu, can you please update the patch?
Comment 4 Matthieu Bouron 2015-01-23 14:11:05 UTC
Created attachment 295274 [details] [review]
aiffmux: write padding byte at end of SSND chunk if needed

Sorry for the delay. Patch updated.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-23 15:13:44 UTC
The following fix has been pushed:
6716671 aiffmux: write padding byte at end of SSND chunk if needed
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-23 15:13:53 UTC
Created attachment 295279 [details] [review]
aiffmux: write padding byte at end of SSND chunk if needed

AIFF chunks are supposed to be even aligned.

Aligning the SSND chunk will allow the aiff muxer to properly write
chunks (like the ID3 one) at the end of the file.