Summary: | Zero length and bitrate for certain WavPack files | ||
---|---|---|---|
Product: | [Frameworks and Libraries] taglib | Reporter: | Tim De Baets <info> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lalinsky |
Priority: | NOR | ||
Version: | 1.6.3 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Tim De Baets
2010-11-26 21:09:22 UTC
It turns out this is completely valid. The specification allows the total_samples header field to be "empty" (represented as 0xFFFFFF), which means unknown length. This file does have the header field set this way, so there is no way to determine the length without actually decoding the file. http://www.wavpack.com/file_format.txt Too bad, guess I will have to tell the user to create the WavPack files with a different application then, or to report this to that application's developers (provided that he created the file himself, and didn't download it). I noticed that dBpoweramp's Audio Properties tab in the file's properties does show the correct length, so I'm still wondering how it does that. Do you think that it decodes the file? Actually, I'll try something else. The file format specification suggests that the WavPack decoder can seek to the end of the file to determine the length somehow. I'll check the code to see how it does that. Ok, so I was wrong. What I can do is to find the last block and its block_index + block_samples should be the total samples in the file. I'm not sure what is the best way to find the last block, as I don't know its size, but I'll try to come up with something. SVN commit 1201476 by lalinsky: Fix reading of WavPack streams without a length information in the header When the WavPack's total_samples header fiels contains -1, try to find the final block and get the number of samples from there as block_index + block_samples. BUG:258016 M +2 -0 NEWS M +1 -2 taglib/wavpack/wavpackfile.cpp M +50 -1 taglib/wavpack/wavpackproperties.cpp M +10 -0 taglib/wavpack/wavpackproperties.h M +2 -0 tests/CMakeLists.txt M +4 -2 tests/Makefile.am AM tests/data/no_length.wv A tests/test_wavpack.cpp [License: UNKNOWN] WebSVN link: http://websvn.kde.org/?view=rev&revision=1201476 Works great now, thanks :) |