summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-07-29 10:40:37 +0200
committerMax Kellermann <max@musicpd.org>2019-07-29 10:40:37 +0200
commitb95533488283a9ea35a82084c8496715d38a0ba3 (patch)
tree294cbc8d08e63de9d2942a3076273680ac36853a /src
parent90ea3bf985b94e1e2bc3dc77d79fc2f948c303b3 (diff)
decoder/opus: ignore case in replay gain tag names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/604
Diffstat (limited to 'src')
-rw-r--r--src/decoder/plugins/OpusTags.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/decoder/plugins/OpusTags.cxx b/src/decoder/plugins/OpusTags.cxx
index c0a14fa89..76ea63e6e 100644
--- a/src/decoder/plugins/OpusTags.cxx
+++ b/src/decoder/plugins/OpusTags.cxx
@@ -22,12 +22,12 @@
#include "lib/xiph/XiphTags.hxx"
#include "tag/Handler.hxx"
#include "tag/ParseName.hxx"
+#include "util/ASCII.hxx"
#include "ReplayGainInfo.hxx"
#include <string>
#include <stdint.h>
-#include <string.h>
#include <stdlib.h>
gcc_pure
@@ -46,7 +46,7 @@ ScanOneOpusTag(const char *name, const char *value,
ReplayGainInfo *rgi,
TagHandler &handler) noexcept
{
- if (rgi != nullptr && strcmp(name, "R128_TRACK_GAIN") == 0) {
+ if (rgi != nullptr && StringEqualsCaseASCII(name, "R128_TRACK_GAIN")) {
/* R128_TRACK_GAIN is a Q7.8 fixed point number in
dB */
@@ -54,7 +54,8 @@ ScanOneOpusTag(const char *name, const char *value,
long l = strtol(value, &endptr, 10);
if (endptr > value && *endptr == 0)
rgi->track.gain = double(l) / 256.;
- } else if (rgi != nullptr && strcmp(name, "R128_ALBUM_GAIN") == 0) {
+ } else if (rgi != nullptr &&
+ StringEqualsCaseASCII(name, "R128_ALBUM_GAIN")) {
/* R128_ALBUM_GAIN is a Q7.8 fixed point number in
dB */