[vlc-commits] DirectSound: fix SPDIF
Andy Tather
git at videolan.org
Thu Dec 5 18:35:07 CET 2013
vlc/vlc-2.1 | branch: master | Andy Tather <andy at andytather.co.uk> | Thu Dec 5 18:33:26 2013 +0100| [2147391ece792013d828d5d080e912b428e3af92] | committer: Jean-Baptiste Kempf
DirectSound: fix SPDIF
Close #9522
(cherry picked from commit 4f3bc33fee31bea49fd17306cc5201bb3eb2968a)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=2147391ece792013d828d5d080e912b428e3af92
---
modules/audio_output/directx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c
index 64ffc13..b43a184 100644
--- a/modules/audio_output/directx.c
+++ b/modules/audio_output/directx.c
@@ -184,7 +184,7 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
if ( AOUT_FMT_SPDIF( fmt ) && var_InheritBool( p_aout, "spdif" )
&& CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL, fmt->i_physical_channels,
- aout_FormatNbChannels( fmt ), fmt->i_rate, true )
+ aout_FormatNbChannels( fmt ), fmt->i_rate, false )
== VLC_SUCCESS )
{
msg_Dbg( p_aout, "using A/52 pass-through over S/PDIF" );
@@ -580,6 +580,10 @@ static int CreateDSBuffer( audio_output_t *p_aout, int i_format,
dsbdesc.dwBufferBytes = DS_BUF_SIZE; /* buffer size */
dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&waveformat;
+ /* CreateSoundBuffer doesn't allow volume control for non-PCM buffers */
+ if ( i_format == VLC_CODEC_SPDIFL )
+ dsbdesc.dwFlags &= ~DSBCAPS_CTRLVOLUME;
+
if FAILED( IDirectSound_CreateSoundBuffer(
p_aout->sys->p_dsobject, &dsbdesc,
&p_aout->sys->p_dsbuffer, NULL) )
More information about the vlc-commits
mailing list