| Summary: | RVA2 frames handled incorrectly | ||
|---|---|---|---|
| Product: | [Unmaintained] taglib | Reporter: | Stephen F. Booth <me> |
| Component: | general | Assignee: | Scott Wheeler <wheeler> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Other | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Version: (using KDE Devel) Installed from: Compiled sources Compiler: gcc version 4.0.1 (Apple Computer, Inc. build 5367) OS: OS X The gain adjustment is handled incorrectly when set (it is currently divided by 512 and should be multiplied), and the tag is parsed incorrectly because the separator length is not accounted for. The following patch fixes both issues: Index: relativevolumeframe.cpp =================================================================== --- relativevolumeframe.cpp (revision 651409) +++ relativevolumeframe.cpp (working copy) @@ -130,7 +130,7 @@ void RelativeVolumeFrame::setVolumeAdjustment(float adjustment, ChannelType type) { - d->channels[type].volumeAdjustment = short(adjustment / float(512)); + d->channels[type].volumeAdjustment = short(adjustment * float(512)); } void RelativeVolumeFrame::setVolumeAdjustment(float adjustment) @@ -164,8 +164,10 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data) { - uint pos = data.find(textDelimiter(String::Latin1)); + ByteVector delimiter = textDelimiter(String::Latin1); + uint pos = data.find(delimiter); d->identification = String(data.mid(0, pos), String::Latin1); + pos += delimiter.size(); // Each channel is at least 4 bytes.