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 711699 - wavenc: bogus header generated
wavenc: bogus header generated
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.2.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-08 16:37 UTC by Philippe Normand
Modified: 2013-11-09 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.47 KB, patch)
2013-11-08 17:03 UTC, Philippe Normand
needs-work Details | Review
updated patch (1.33 KB, patch)
2013-11-09 10:10 UTC, Philippe Normand
none Details | Review
patch (1.95 KB, patch)
2013-11-09 10:16 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2013-11-08 16:37:24 UTC
Before commit db29522a430e44450415ca3676abd1b77ee923d9 the encoder used to generate a WAVE header with a bogus size and on EOS rewrite it appropriately (IIUC).

After that commit the wave.data.len attribute value is zero in gst_wavenc_create_header_buf() instead of... 0x7FFF0000 in the previous state of the element.

That seems to have bad side effects on the webkit WebAudio playback pipeline. The wavenc element used there errors out. I can't yet reproduce that issue outside of WebKit though... But I thought I'd open a bug anyway, even if it ends up closed INVALID :)
Comment 1 Philippe Normand 2013-11-08 17:03:39 UTC
Created attachment 259287 [details] [review]
proposed patch
Comment 2 Sebastian Dröge (slomo) 2013-11-09 09:58:20 UTC
Review of attachment 259287 [details] [review]:

::: gst/wavenc/gstwavenc.c
@@ +896,3 @@
       wavenc->rate = 0;
       wavenc->audio_length = 0;
+      wavenc->meta_length = 0x7FFF0000;

I think you want to initialize audio_length here. But also it has to be reset to 0 after pushing the initial header because later it is only incremented (same as meta_length, both only get += buffer_size).
Comment 3 Philippe Normand 2013-11-09 10:10:04 UTC
Created attachment 259313 [details] [review]
updated patch
Comment 4 Philippe Normand 2013-11-09 10:16:01 UTC
Created attachment 259314 [details] [review]
patch

now with comments :)
Comment 5 Sebastian Dröge (slomo) 2013-11-09 10:22:42 UTC
commit 0ee332378bb7c869bd80dad3cdbe6c7464f182a3
Author: Philippe Normand <philn@igalia.com>
Date:   Fri Nov 8 17:59:24 2013 +0100

    wavenc: generate a non-empty data header
    
    Restore the behavior of the element to the state before commit
    db29522a430e44450415ca3676abd1b77ee923d9. A non-empty header is
    generated and when the EOS event is received the header is generated
    again, this time with the correct size.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711699