decoder/dsdiff: fix byte order bug

This commit is contained in:
Jurgen Kramer 2013-11-09 17:02:49 +01:00 committed by Max Kellermann
parent 573ff3a24f
commit 47d3758820
3 changed files with 15 additions and 2 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.18.4 (not yet released) ver 0.18.4 (not yet released)
* decoder
- dsdiff: fix byte order bug
ver 0.18.3 (2013/11/08) ver 0.18.3 (2013/11/08)
* fix stuck MPD after song change (0.18.2 regression) * fix stuck MPD after song change (0.18.2 regression)

View File

@ -47,6 +47,17 @@ public:
} }
}; };
class DffDsdUint64 {
uint32_t hi;
uint32_t lo;
public:
constexpr uint64_t Read() const {
return (uint64_t(FromBE32(hi)) << 32) |
uint64_t(FromBE32(lo));
}
};
bool bool
dsdlib_read(Decoder *decoder, InputStream &is, dsdlib_read(Decoder *decoder, InputStream &is,
void *data, size_t length); void *data, size_t length);

View File

@ -43,13 +43,13 @@
struct DsdiffHeader { struct DsdiffHeader {
DsdId id; DsdId id;
DsdUint64 size; DffDsdUint64 size;
DsdId format; DsdId format;
}; };
struct DsdiffChunkHeader { struct DsdiffChunkHeader {
DsdId id; DsdId id;
DsdUint64 size; DffDsdUint64 size;
/** /**
* Read the "size" attribute from the specified header, converting it * Read the "size" attribute from the specified header, converting it