GNOME Bugzilla – Bug 440997
[gstriff] Doesn't handle width!=depth files with audio/x-raw-int properly
Last modified: 2007-05-31 17:10:43 UTC
in current CVS wavparse and wavenc don't handle audio/x-raw-int files with width!=depth correctly.
Our own representation of such samples has the lowest $depth bits set while wav expects the highest $depth bits to be set. So every sample should be shifted by "width-depth" to the left before writing/after reading.
contains a sample file. For wavenc just try to open a file with width!=depth in audacity :)
Created attachment 88943 [details] [review]
Patch to fix the problem
ignore the size field, samples are just stored with the least significant bits cleared.
That's only for the wavparse part though but should work fine :)
wavenc would still need some special handling. I'll try to find some time for it in the next days...
Ok, let's reassign this to plugins-base and mark as blocker for the release. This should be committed IMHO as width!=depth is a new feature this release and it is currently broken...
Created attachment 89106 [details] [review]
Ok, here's the same patch with the change in both places to also work with extended wave files.
Would be nice if someone committed this ;)
Committed without the FIXMEs, because there's no need to fix this later:
2007-05-31 Jan Schmidt <email@example.com>
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
In riff, the depth is stored in the size field but it just means that
the least significant bits are cleared. We can therefore just play
the sample as if it had a depth == width. Fixes: #440997
Patch by: Wim Taymans <firstname.lastname@example.org>
Patch by: Sebastian Dröge <email@example.com>