* directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.8 2002/11/15 16:27:10 gbazin Exp $
+ * $Id: directx.c,v 1.9 2002/11/26 22:20:18 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
{
LPDIRECTSOUND p_dsobject; /* main Direct Sound object */
- LPDIRECTSOUNDBUFFER p_dsbuffer_primary; /* the actual sound card buffer
- (not used directly) */
-
LPDIRECTSOUNDBUFFER p_dsbuffer; /* the sound buffer we use (direct sound
* takes care of mixing all the
* secondary buffers into the primary) */
static int OpenAudio( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
- HRESULT dsresult;
- DSBUFFERDESC dsbuffer_desc;
int i;
msg_Dbg( p_aout, "Open" );
/* Initialize some variables */
p_aout->output.p_sys->p_dsobject = NULL;
- p_aout->output.p_sys->p_dsbuffer_primary = NULL;
p_aout->output.p_sys->p_dsbuffer = NULL;
p_aout->output.p_sys->p_dsnotify = NULL;
p_aout->output.p_sys->p_notif = NULL;
goto error;
}
- /* Obtain (not create) Direct Sound primary buffer */
- memset( &dsbuffer_desc, 0, sizeof(DSBUFFERDESC) );
- dsbuffer_desc.dwSize = sizeof(DSBUFFERDESC);
- dsbuffer_desc.dwFlags = DSBCAPS_PRIMARYBUFFER;
- msg_Warn( p_aout, "create direct sound primary buffer" );
- dsresult = IDirectSound_CreateSoundBuffer(p_aout->output.p_sys->p_dsobject,
- &dsbuffer_desc,
- &p_aout->output.p_sys->p_dsbuffer_primary,
- NULL);
- if( dsresult != DS_OK )
- {
- msg_Err( p_aout, "cannot create direct sound primary buffer" );
- goto error;
- }
-
/* Now we need to setup DirectSound play notification */
p_aout->output.p_sys->p_notif =
vlc_object_create( p_aout, sizeof(notification_thread_t) );
/* release the secondary buffer */
DirectxDestroySecondaryBuffer( p_aout );
- /* then release the primary buffer */
- if( p_aout->output.p_sys->p_dsbuffer_primary )
- IDirectSoundBuffer_Release( p_aout->output.p_sys->p_dsbuffer_primary );
-
/* finally release the DirectSound object */
if( p_aout->output.p_sys->p_dsobject )
IDirectSound_Release( p_aout->output.p_sys->p_dsobject );
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.8 2002/11/26 19:31:50 gbazin Exp $
+ * $Id: directx.c,v 1.9 2002/11/26 22:20:18 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
{
/* DirectX 3 doesn't support the DDLOCK_NOSYSLOCK flag, resulting
* in an invalid params error */
- dxresult = IDirectDrawSurface2_Restore( p_pic->p_sys->p_surface );
dxresult = IDirectDrawSurface2_Lock( p_pic->p_sys->p_surface, NULL,
&p_pic->p_sys->ddsd,
DDLOCK_WAIT, NULL);