summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorMia Herkt <mia@0x0.st>2020-10-23 14:22:57 +0200
committerMia Herkt <mia@0x0.st>2020-10-23 14:22:57 +0200
commit49d6a1e77d3dba5cf30a2cb9cd05dc6dd6407fb2 (patch)
treeec43b53f6daa58d9dceb0ab0f8fb22b5d657fb80 /demux
parenta92466c28959536cd3b1e7fa5ce31232a2b9a5fd (diff)
downloadmpv-49d6a1e77d3dba5cf30a2cb9cd05dc6dd6407fb2.tar.bz2
mpv-49d6a1e77d3dba5cf30a2cb9cd05dc6dd6407fb2.tar.xz
demux_lavf: initialize ReplayGain data
This was causing undefined behavior when playing streams without RG tags but with RG enabled. Broken in 585f9ff42f3195c. Thanks to uau for bisecting.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 6aaf279c4b..1bc8699e15 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -610,6 +610,8 @@ static void export_replaygain(demuxer_t *demuxer, struct sh_stream *sh,
av_rgain = (AVReplayGain*)src_sd->data;
rgain = talloc_ptrtype(demuxer, rgain);
+ rgain->track_gain = rgain->album_gain = 0;
+ rgain->track_peak = rgain->album_peak = 1;
// Set values in *rgain, using track gain as a fallback for album gain
// if the latter is not present. This behavior matches that in