aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/DsdiffDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-16 21:09:19 +0200
committerMax Kellermann <max@duempel.org>2013-10-16 22:09:44 +0200
commit5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f (patch)
treefccf16ec9b798ab06913250073e003b2830d2817 /src/decoder/DsdiffDecoderPlugin.cxx
parent08eca827b659f2becc872c151919948b5a9ffe4d (diff)
downloadmpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.tar.gz
mpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.tar.xz
mpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.zip
system/ByteOrder: new library for byte ordering / endianess
Replacing GLib macros.
Diffstat (limited to 'src/decoder/DsdiffDecoderPlugin.cxx')
-rw-r--r--src/decoder/DsdiffDecoderPlugin.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/DsdiffDecoderPlugin.cxx b/src/decoder/DsdiffDecoderPlugin.cxx
index 43002768a..c4150dd91 100644
--- a/src/decoder/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/DsdiffDecoderPlugin.cxx
@@ -33,6 +33,7 @@
#include "CheckAudioFormat.hxx"
#include "util/bit_reverse.h"
#include "util/Error.hxx"
+#include "system/ByteOrder.hxx"
#include "tag/TagHandler.hxx"
#include "DsdLib.hxx"
#include "Log.hxx"
@@ -56,8 +57,8 @@ struct DsdiffChunkHeader {
*/
gcc_const
uint64_t GetSize() const {
- return (((uint64_t)GUINT32_FROM_BE(size_high)) << 32) |
- ((uint64_t)GUINT32_FROM_BE(size_low));
+ return (uint64_t(FromBE32(size_high)) << 32) |
+ uint64_t(FromBE32(size_low));
}
};
@@ -141,7 +142,7 @@ dsdiff_read_prop_snd(struct decoder *decoder, struct input_stream *is,
sizeof(sample_rate)))
return false;
- metadata->sample_rate = GUINT32_FROM_BE(sample_rate);
+ metadata->sample_rate = FromBE32(sample_rate);
} else if (dsdlib_id_equals(&header.id, "CHNL")) {
uint16_t channels;
if (header.GetSize() < sizeof(channels) ||
@@ -150,7 +151,7 @@ dsdiff_read_prop_snd(struct decoder *decoder, struct input_stream *is,
!dsdlib_skip_to(decoder, is, chunk_end_offset))
return false;
- metadata->channels = GUINT16_FROM_BE(channels);
+ metadata->channels = FromBE16(channels);
} else if (dsdlib_id_equals(&header.id, "CMPR")) {
struct dsdlib_id type;
if (header.GetSize() < sizeof(type) ||
@@ -211,7 +212,7 @@ dsdiff_handle_native_tag(struct input_stream *is,
if (!dsdlib_read(nullptr, is, &metatag, sizeof(metatag)))
return;
- uint32_t length = GUINT32_FROM_BE(metatag.size);
+ uint32_t length = FromBE32(metatag.size);
/* Check and limit size of the tag to prevent a stack overflow */
if (length == 0 || length > 60)