diff options
author | wm4 <wm4@nowhere> | 2016-08-13 15:06:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-13 15:06:45 +0200 |
commit | e392d6610d1e35cc0190c794c151211b0aae83e6 (patch) | |
tree | f566d9b65e929fe1f31694deb743be9368ff704d | |
parent | 78d808c5bdeb7146374068c1f5c535d36c7a0001 (diff) | |
download | mpv-e392d6610d1e35cc0190c794c151211b0aae83e6.tar.bz2 mpv-e392d6610d1e35cc0190c794c151211b0aae83e6.tar.xz |
demux: make ALBUM replaygain tags optional
IF they're missing, use the TRACK ones instead. See #3405.
-rw-r--r-- | demux/demux.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c index e7fcb88e10..95da4f2843 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -975,10 +975,14 @@ static struct replaygain_data *decode_rgain(struct mp_log *log, struct replaygain_data rg = {0}; if (!decode_gain(log, tags, "REPLAYGAIN_TRACK_GAIN", &rg.track_gain) && - !decode_peak(log, tags, "REPLAYGAIN_TRACK_PEAK", &rg.track_peak) && - !decode_gain(log, tags, "REPLAYGAIN_ALBUM_GAIN", &rg.album_gain) && - !decode_peak(log, tags, "REPLAYGAIN_ALBUM_PEAK", &rg.album_peak)) + !decode_peak(log, tags, "REPLAYGAIN_TRACK_PEAK", &rg.track_peak)) { + if (!(!decode_gain(log, tags, "REPLAYGAIN_ALBUM_GAIN", &rg.album_gain) && + !decode_peak(log, tags, "REPLAYGAIN_ALBUM_PEAK", &rg.album_peak))) + { + rg.album_gain = rg.track_gain; + rg.album_peak = rg.track_peak; + } return talloc_memdup(NULL, &rg, sizeof(rg)); } |