GNOME Bugzilla – Bug 636245
[riff] For ADPCM codecs the average bitrate should be calculated instead of trusting the format header
Last modified: 2013-05-07 13:02:58 UTC
Some ADPCM encoding tools like Oxelon generate WAV files with wrong format header declaring an invalid bitrate. As wavparse uses the average bitrate to calculate timestamps and duration the decoder can be confused by receiving timestamps completely out of sync with the decoded samples. ADPCM is a CBR audio codec so we can calculate the average bitrate instead of trusting the format header.
Created attachment 175655 [details] Sample WAV file with ADPCM encoded with Oxelon
Created attachment 175656 [details] [review] Proposed patch for ADPCM IMA DVI and Microsoft
Created attachment 179077 [details] [review] Improved ADPCM bitrate calculation patch for riff-media.c I did not take in account the preamble bytes in the bitrate calculation. The bitrate now allows wavparse to generate proper timestamps which identity confirms as being a perfect stream.
Created attachment 179078 [details] [review] Improved ADPCM bitrate calculation patch for riff-media.c for MS ADPCM Just realized that Microsoft's layout for ADPCM has a 7 bytes preamble instead of 4 bytes like IMA ADPCM variants.
commit 6f9006c9b9753f47733ea17f803a63ea5a1500ef Author: Julien Moutte <julien@moutte.net> Date: Tue May 7 15:00:05 2013 +0200 riff: Manually calculate bitrate of ADPCM streams Some ADPCM encoding tools like Oxelon generate WAV files with wrong format header declaring an invalid bitrate. As wavparse uses the average bitrate to calculate timestamps and duration the decoder can be confused by receiving timestamps completely out of sync with the decoded samples. ADPCM is a CBR audio codec so we can calculate the average bitrate instead of trusting the format header. https://bugzilla.gnome.org/show_bug.cgi?id=636245
*** Bug 699804 has been marked as a duplicate of this bug. ***