decoder/opus: add support for R128_ALBUM_GAIN tag

This commit is contained in:
Michal Koutenský 2018-05-04 20:29:12 +02:00 committed by Max Kellermann
parent b763852f57
commit d495ec71a8
2 changed files with 9 additions and 0 deletions

1
NEWS
View File

@ -4,6 +4,7 @@ ver 0.20.20 (not yet released)
* decoder
- dsdiff, dsf: support more MIME types
- dsdiff, dsf: allow 4 MB ID3 tags
- opus: support R128_ALBUM_GAIN tag
ver 0.20.19 (2018/04/26)
* protocol

View File

@ -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);