aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/OpusDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-24 23:56:06 +0200
committerMax Kellermann <max@duempel.org>2013-10-24 23:56:06 +0200
commitac8e5be9f4342ec6b746dfb12d21700d7409a07d (patch)
tree0ae5918a96ea467003249be0226fac0f0cb94a9c /src/decoder/OpusDecoderPlugin.cxx
parentc76952534e0ab82b179d360f07beceb634a0a154 (diff)
downloadmpd-ac8e5be9f4342ec6b746dfb12d21700d7409a07d.tar.gz
mpd-ac8e5be9f4342ec6b746dfb12d21700d7409a07d.tar.xz
mpd-ac8e5be9f4342ec6b746dfb12d21700d7409a07d.zip
decoder/opus: support replay gain
Parse the R128_TRACK_GAIN comment string.
Diffstat (limited to 'src/decoder/OpusDecoderPlugin.cxx')
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index fd8ed4e89..a8f0703fb 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -282,12 +282,18 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
inline DecoderCommand
MPDOpusDecoder::HandleTags(const ogg_packet &packet)
{
+ replay_gain_info rgi;
+ replay_gain_info_init(&rgi);
+
TagBuilder tag_builder;
DecoderCommand cmd;
if (ScanOpusTags(packet.packet, packet.bytes,
+ &rgi,
&add_tag_handler, &tag_builder) &&
!tag_builder.IsEmpty()) {
+ decoder_replay_gain(decoder, &rgi);
+
Tag tag;
tag_builder.Commit(tag);
cmd = decoder_tag(decoder, input_stream, std::move(tag));
@@ -439,6 +445,7 @@ mpd_opus_scan_stream(InputStream &is,
break;
else if (IsOpusTags(packet)) {
if (!ScanOpusTags(packet.packet, packet.bytes,
+ nullptr,
handler, handler_ctx))
result = false;