[vlc-commits] wasapi: fix passthrough with DTS WAV
Thomas Guillem
git at videolan.org
Wed Jul 11 13:36:32 CEST 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 11 13:17:30 2018 +0200| [3c68e5ff1ff8da2936da1db4bd9b4e2c4c93c06b] | committer: Thomas Guillem
wasapi: fix passthrough with DTS WAV
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c68e5ff1ff8da2936da1db4bd9b4e2c4c93c06b
---
modules/audio_output/wasapi.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index ee9baf28e7..6a992799d7 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -43,6 +43,11 @@ DEFINE_GUID(_KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL,
WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00,
0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
+/* 00000001-0000-0010-8000-00aa00389b71 */
+DEFINE_GUID(_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX,
+ WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00,
+ 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
+
/* 00000008-0000-0010-8000-00aa00389b71 */
DEFINE_GUID(_KSDATAFORMAT_SUBTYPE_IEC61937_DTS,
WAVE_FORMAT_DTS_MS, 0x0000, 0x0010, 0x80, 0x00,
@@ -306,7 +311,13 @@ static void vlc_SpdifToWave(WAVEFORMATEXTENSIBLE *restrict wf,
switch (audio->i_format)
{
case VLC_CODEC_DTS:
- wf->SubFormat = _KSDATAFORMAT_SUBTYPE_IEC61937_DTS;
+ if (audio->i_rate < 48000)
+ {
+ /* Wasapi doesn't accept DTS @ 44.1kHz but accept IEC 60958 PCM */
+ wf->SubFormat = _KSDATAFORMAT_SUBTYPE_WAVEFORMATEX;
+ }
+ else
+ wf->SubFormat = _KSDATAFORMAT_SUBTYPE_IEC61937_DTS;
break;
case VLC_CODEC_SPDIFL:
case VLC_CODEC_SPDIFB:
More information about the vlc-commits
mailing list