/*****************************************************************************
* directx.c: Windows DirectX audio output method
*****************************************************************************
- * Copyright (C) 2001 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
static void Probe ( aout_instance_t * );
static int InitDirectSound ( aout_instance_t * );
static int CreateDSBuffer ( aout_instance_t *, int, int, int, int, int, bool );
-static int CreateDSBufferPCM ( aout_instance_t *, int*, int, int, int, bool );
+static int CreateDSBufferPCM ( aout_instance_t *, vlc_fourcc_t*, int, int, int, bool );
static void DestroyDSBuffer ( aout_instance_t * );
static void* DirectSoundThread( vlc_object_t * );
static int FillBuffer ( aout_instance_t *, int, aout_buffer_t * );
static void Probe( aout_instance_t * p_aout )
{
vlc_value_t val, text;
- int i_format;
+ vlc_fourcc_t i_format;
unsigned int i_physical_channels;
DWORD ui_speaker_config;
bool is_default_output_set = false;
AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT |
AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE;
- if( p_aout->output.output.i_physical_channels == i_physical_channels )
- {
- if( CreateDSBufferPCM( p_aout, &i_format, i_physical_channels, 8,
+ if( p_aout->output.output.i_physical_channels == i_physical_channels )
+ {
+ if( CreateDSBufferPCM( p_aout, &i_format, i_physical_channels, 8,
p_aout->output.output.i_rate, true )
- == VLC_SUCCESS )
- {
- val.i_int = AOUT_VAR_7_1;
- text.psz_string = (char*) "7.1";
- var_Change( p_aout, "audio-device",
- VLC_VAR_ADDCHOICE, &val, &text );
- var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
- is_default_output_set = true;
- msg_Dbg( p_aout, "device supports 7.1 channels" );
- }
- }
+ == VLC_SUCCESS )
+ {
+ val.i_int = AOUT_VAR_7_1;
+ text.psz_string = (char*) "7.1";
+ var_Change( p_aout, "audio-device",
+ VLC_VAR_ADDCHOICE, &val, &text );
+ var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+ is_default_output_set = true;
+ msg_Dbg( p_aout, "device supports 7.1 channels" );
+ }
+ }
/* Test for 3 Front 2 Rear support */
i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCSTR psz_desc,
LPCSTR psz_mod, LPVOID _p_aout )
{
+ VLC_UNUSED( psz_mod );
+
aout_instance_t *p_aout = (aout_instance_t *)_p_aout;
msg_Dbg( p_aout, "found device: %s", psz_desc );
* We first try to create a WAVE_FORMAT_IEEE_FLOAT buffer if supported by
* the hardware, otherwise we create a WAVE_FORMAT_PCM buffer.
****************************************************************************/
-static int CreateDSBufferPCM( aout_instance_t *p_aout, int *i_format,
+static int CreateDSBufferPCM( aout_instance_t *p_aout, vlc_fourcc_t *i_format,
int i_channels, int i_nb_channels, int i_rate,
bool b_probe )
{
notification_thread_t *p_notif = p_aout->output.p_sys->p_notif;
aout_sys_t *p_sys = p_aout->output.p_sys;
void *p_write_position, *p_wrap_around;
- long l_bytes1, l_bytes2;
+ unsigned long l_bytes1, l_bytes2;
HRESULT dsresult;
/* Before copying anything, we have to lock the buffer */