[FFmpeg-devel] [PATCH 2/3] avformat/wvdec: Export version as extradata

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Thu Mar 26 06:05:38 EET 2020


It might be used by the Matroska muxer. This is also the reason why the
FATE-tests for muxing WavPack into Matroska needed to be updated: They
now write the correct version 4.07 and not 4.03 as before.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/wvdec.c    | 3 +++
 tests/fate/wavpack.mak | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/wvdec.c b/libavformat/wvdec.c
index e56a6932ad..b9fc6a59f9 100644
--- a/libavformat/wvdec.c
+++ b/libavformat/wvdec.c
@@ -250,6 +250,9 @@ static int wv_read_header(AVFormatContext *s)
     st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
+    if ((ret = ff_alloc_extradata(st->codecpar, 2)) < 0)
+        return ret;
+    AV_WL16(st->codecpar->extradata, wc->header.version);
     st->codecpar->codec_type            = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_id              = AV_CODEC_ID_WAVPACK;
     st->codecpar->channels              = wc->chan;
diff --git a/tests/fate/wavpack.mak b/tests/fate/wavpack.mak
index a89cc1293d..bc7a5cc92f 100644
--- a/tests/fate/wavpack.mak
+++ b/tests/fate/wavpack.mak
@@ -91,12 +91,12 @@ fate-wavpack-matroskamode: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/matros
 FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-mono
 fate-wavpack-matroska_mux-mono: CMD = md5pipe -i $(TARGET_SAMPLES)/wavpack/num_channels/mono_16bit_int.wv -c copy -fflags +bitexact -f matroska
 fate-wavpack-matroska_mux-mono: CMP = oneline
-fate-wavpack-matroska_mux-mono: REF = 0a1a7c6d3b413925f8261c92d1d53363
+fate-wavpack-matroska_mux-mono: REF = a9da0444604848080b08e32de19f42d9
 
 FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-61
 fate-wavpack-matroska_mux-61: CMD = md5pipe -i $(TARGET_SAMPLES)/wavpack/num_channels/eva_2.22_6.1_16bit-partial.wv -c copy -fflags +bitexact -f matroska
 fate-wavpack-matroska_mux-61: CMP = oneline
-fate-wavpack-matroska_mux-61: REF = 1f012f7c237f46f2f63089ba84c589c5
+fate-wavpack-matroska_mux-61: REF = 60812e377937456863a3c899ee068060
 
 FATE_SAMPLES_AVCONV += $(FATE_WAVPACK-yes)
 fate-wavpack: $(FATE_WAVPACK-yes)
-- 
2.20.1



More information about the ffmpeg-devel mailing list