]> granicus.if.org Git - taglib/commitdiff
Fix RVA setting / parsing. Patch from Stephen Booth.
authorScott Wheeler <wheeler@kde.org>
Wed, 18 Jul 2007 11:36:26 +0000 (11:36 +0000)
committerScott Wheeler <wheeler@kde.org>
Wed, 18 Jul 2007 11:36:26 +0000 (11:36 +0000)
BUG:107025

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@689477 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

taglib/mpeg/id3v2/frames/relativevolumeframe.cpp

index 78a34e96e5336b2afa58dc96c4e21b1ce8f16e3f..90fc6f33480ec6f58dbffcf5541be12fca705c17 100644 (file)
@@ -130,7 +130,7 @@ float RelativeVolumeFrame::volumeAdjustment() const
 
 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::setPeakVolume(const PeakVolume &peak)
 
 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.