diff options
author | Michal Koutenský <koutak.m@gmail.com> | 2018-05-04 20:29:12 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-05-07 10:57:03 +0200 |
commit | d495ec71a89fe9e1e70263302967c0c774ffdba0 (patch) | |
tree | e448525c86734ff55255839326d77c40141187d9 /src | |
parent | b763852f575fa9395289e7fe3e26f9b133961c81 (diff) |
decoder/opus: add support for R128_ALBUM_GAIN tag
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/plugins/OpusTags.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/decoder/plugins/OpusTags.cxx b/src/decoder/plugins/OpusTags.cxx index 8baeccd2f..41c499aec 100644 --- a/src/decoder/plugins/OpusTags.cxx +++ b/src/decoder/plugins/OpusTags.cxx @@ -53,6 +53,14 @@ 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) { + /* R128_ALBUM_GAIN is a Q7.8 fixed point number in + dB */ + + char *endptr; + long l = strtol(value, &endptr, 10); + if (endptr > value && *endptr == 0) + rgi->album.gain = double(l) / 256.; } tag_handler_invoke_pair(handler, ctx, name, value); |