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 731169 - wavparse: Puts codec_data on raw audio caps
wavparse: Puts codec_data on raw audio caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-03 17:08 UTC by Vincent Penquerc'h
Modified: 2014-06-05 09:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adder: do not reject caps which differ only by codec_data (1.72 KB, patch)
2014-06-03 17:08 UTC, Vincent Penquerc'h
rejected Details | Review
do not include codec data on raw audio caps (1.56 KB, patch)
2014-06-04 10:37 UTC, Vincent Penquerc'h
accepted-commit_now Details | Review
do not include codec data on raw etc type type type again (1.56 KB, patch)
2014-06-05 09:42 UTC, Vincent Penquerc'h
none Details | Review

Description Vincent Penquerc'h 2014-06-03 17:08:51 UTC
Created attachment 277818 [details] [review]
adder: do not reject caps which differ only by codec_data

This lets a pipeline such as [1] work.

gst-launch-1.0 filesrc location=/home/v/Samples/8.wav  ! wavparse ! audioconvert ! audioresample ! 'audio/x-raw,format=S32LE,rate=48000,channels=2' ! queue name=q48 ! adder name=mix  ! queue ! audioconvert ! alsasink     filesrc location=/home/v/Samples/6.wav ! wavparse ! audioconvert ! audioresample ! 'audio/x-raw,format=S32LE,rate=48000,channels=2' ! queue name=q44 ! mix.
Comment 1 Tim-Philipp Müller 2014-06-03 21:26:59 UTC
Comment on attachment 277818 [details] [review]
adder: do not reject caps which differ only by codec_data

I don't think this makes sense. There should be no codec_data field on raw audio caps.
Comment 2 Vincent Penquerc'h 2014-06-04 08:09:16 UTC
Aaah, I was surprised to see those here.
If it really is unexpected, I'll go look at what is setting them.
Comment 3 Vincent Penquerc'h 2014-06-04 08:31:06 UTC
This is the contents of the "strf" chunk in a wav file. This is from the riff code in -base/gst-libs and seems quite deliberate. wavparse calls this via gst_riff_parse_strf_auds.
Comment 4 Sebastian Dröge (slomo) 2014-06-04 09:02:03 UTC
It shouldn't really do that :)
Comment 5 Vincent Penquerc'h 2014-06-04 09:48:23 UTC
It's been there since 2007 at least though. Removing it might break something that expects it...
Comment 6 Vincent Penquerc'h 2014-06-04 10:37:34 UTC
Created attachment 277863 [details] [review]
do not include codec data on raw audio caps

Reading the riff lib code, we want to keep this field sometimes as we can get non-raw data. So the best seems to be to remove the field after parsing if we get raw data.
Comment 7 Tim-Philipp Müller 2014-06-04 18:40:56 UTC
Comment on attachment 277863 [details] [review]
do not include codec data on raw audio caps

Looks fine, minor nit:

>+    /* If we got raw audio from upstream, we remove the codec_data field,
>+       which may have been added if the wav header included an extended
>+       chunk. We want to keep it for non raw audio. */

Note how our code usually uses a '*' at the beginning of each comment line for multi-line comments:

>     /* do more sanity checks of header fields
>      * (these can be sanitized by gst_riff_create_audio_caps()
>      */
Comment 8 Vincent Penquerc'h 2014-06-05 09:42:03 UTC
Created attachment 277939 [details] [review]
do not include codec data on raw etc type type type again

Done. I put the */ on a new line, I see both this and end of lines styles, but the closest multiline comment is new line, so it won.
Comment 9 Vincent Penquerc'h 2014-06-05 09:42:58 UTC
commit 40ae581ef297839f38dd747444d5e6aa31dea29e
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Wed Jun 4 11:34:27 2014 +0100

    wavparse: do not include codec_data on raw audio caps
    
    If the wav header contains an extended chunk, we want to keep
    the codec_data field, but not for raw audio.
    
    This fixes some elements (such as adder) from failing to intersect
    raw audio caps which would otherwise be intersectable.