From bad2cea1225d38e2c836e58771f9470760f61b70 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Sun, 20 Dec 2020 11:47:04 +0100 Subject: [PATCH] WAV: Support subformat in WAVE_FORMAT_EXTENSIBLE (#850) --- taglib/riff/wav/wavproperties.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/taglib/riff/wav/wavproperties.cpp b/taglib/riff/wav/wavproperties.cpp index 181e3a6c..4174db46 100644 --- a/taglib/riff/wav/wavproperties.cpp +++ b/taglib/riff/wav/wavproperties.cpp @@ -183,6 +183,14 @@ void RIFF::WAV::Properties::read(File *file) } d->format = data.toShort(0, false); + if((d->format & 0xffff) == 0xfffe) { + // if extensible then read the format from the subformat + if(data.size() != 40) { + debug("RIFF::WAV::Properties::read() - extensible size incorrect"); + return; + } + d->format = data.toShort(24, false); + } if(d->format != FORMAT_PCM && totalSamples == 0) { debug("RIFF::WAV::Properties::read() - Non-PCM format, but 'fact' chunk not found."); return;