mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Fix from Felix Berger to get RVA2 frames a little closer
to working. The more complicated fix for #107025 will follow shortly. BUG:95545 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437091 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
19a0504dfd
commit
e321ae7774
@ -19,6 +19,8 @@
|
||||
* USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <tdebug.h>
|
||||
|
||||
#include "relativevolumeframe.h"
|
||||
|
||||
using namespace TagLib;
|
||||
@ -101,9 +103,17 @@ void RelativeVolumeFrame::setPeakVolume(const PeakVolume &peak)
|
||||
|
||||
void RelativeVolumeFrame::parseFields(const ByteVector &data)
|
||||
{
|
||||
if(data.size() < 6) {
|
||||
debug("A relative volume frame must contain at least 6 bytes.");
|
||||
return;
|
||||
}
|
||||
|
||||
int pos = data.find(textDelimiter(String::Latin1));
|
||||
d->identification = String(data.mid(0, pos), String::Latin1);
|
||||
|
||||
d->channelType = ChannelType(data[pos]);
|
||||
pos += 1;
|
||||
|
||||
d->volumeAdjustment = data.mid(pos, 2).toShort();
|
||||
pos += 2;
|
||||
|
||||
@ -119,6 +129,7 @@ ByteVector RelativeVolumeFrame::renderFields() const
|
||||
|
||||
data.append(d->identification.data(String::Latin1));
|
||||
data.append(textDelimiter(String::Latin1));
|
||||
data.append(char(d->channelType));
|
||||
data.append(ByteVector::fromShort(d->volumeAdjustment));
|
||||
data.append(char(d->peakVolume.bitsRepresentingPeak));
|
||||
data.append(d->peakVolume.peakVolume);
|
||||
|
Loading…
x
Reference in New Issue
Block a user