mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 13:04:18 -04:00
Correctly decode signed values
In SV7 these are a mix of signed and unsigned shorts; in SV8 they're all signed. Storing them as an int is fine for signed or unsigned shorts as it's wide enough to contain either of them. Unfortunately there are no explicit tests for SV7 at the moment; that would be ideal to add before the next release. CC @carewolf
This commit is contained in:
@ -49,17 +49,17 @@ public:
|
||||
albumGain(0),
|
||||
albumPeak(0) {}
|
||||
|
||||
int version;
|
||||
int length;
|
||||
int bitrate;
|
||||
int sampleRate;
|
||||
int channels;
|
||||
int version;
|
||||
int length;
|
||||
int bitrate;
|
||||
int sampleRate;
|
||||
int channels;
|
||||
unsigned int totalFrames;
|
||||
unsigned int sampleFrames;
|
||||
unsigned int trackGain;
|
||||
unsigned int trackPeak;
|
||||
unsigned int albumGain;
|
||||
unsigned int albumPeak;
|
||||
int trackGain;
|
||||
int trackPeak;
|
||||
int albumGain;
|
||||
int albumPeak;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -311,9 +311,9 @@ void MPC::Properties::readSV7(const ByteVector &data, long streamLength)
|
||||
const unsigned int gapless = data.toUInt(5, false);
|
||||
|
||||
d->trackGain = data.toShort(14, false);
|
||||
d->trackPeak = data.toShort(12, false);
|
||||
d->trackPeak = data.toUShort(12, false);
|
||||
d->albumGain = data.toShort(18, false);
|
||||
d->albumPeak = data.toShort(16, false);
|
||||
d->albumPeak = data.toUShort(16, false);
|
||||
|
||||
// convert gain info
|
||||
if(d->trackGain != 0) {
|
||||
|
Reference in New Issue
Block a user