Bug 145298 - RVA2 frames handled incorrectly
Summary: RVA2 frames handled incorrectly
Status: RESOLVED DUPLICATE of bug 107025
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Other
: NOR normal
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-11 06:53 UTC by Stephen F. Booth
Modified: 2007-07-18 13:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen F. Booth 2007-05-11 06:53:27 UTC
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.
Comment 1 Scott Wheeler 2007-07-18 13:33:11 UTC

*** This bug has been marked as a duplicate of 107025 ***