summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-12 19:33:34 +0200
committerwm4 <wm4@nowhere>2015-07-12 19:33:34 +0200
commit9b15c99aa13acdbb3e86fbb3395ad107b436fdaa (patch)
tree8d046850ecee03edd8de6d1ae79495687d29c19b
parentf052165dbf84b8d5b7620db9ba17254c45beb344 (diff)
downloadmpv-9b15c99aa13acdbb3e86fbb3395ad107b436fdaa.tar.bz2
mpv-9b15c99aa13acdbb3e86fbb3395ad107b436fdaa.tar.xz
demux: handle Matroska-style replaygain tags as well
Matroska doesn't follow the usual ReplayGain conventions, and doesn't distinguish between track/album values. Fixes #2128.
-rw-r--r--demux/demux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 6f20795425..d936f51fd4 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -813,6 +813,14 @@ static void demux_export_replaygain(demuxer_t *demuxer)
{
apply_replaygain(demuxer, &rg);
}
+
+ if (!decode_gain(demuxer, "REPLAYGAIN_GAIN", &rg.track_gain) &&
+ !decode_peak(demuxer, "REPLAYGAIN_PEAK", &rg.track_peak))
+ {
+ rg.album_gain = rg.track_gain;
+ rg.album_peak = rg.track_peak;
+ apply_replaygain(demuxer, &rg);
+ }
}
// Copy all fields from src to dst, depending on event flags.