- if( p_aout->output.p_sys->psz_device &&
- !strcmp(p_aout->output.p_sys->psz_device, psz_device) && p_guid )
- {
- /* Use the device corresponding to psz_device */
- p_aout->output.p_sys->p_device_guid = malloc( sizeof( GUID ) );
- *p_aout->output.p_sys->p_device_guid = *p_guid;
- msg_Dbg( p_aout, "using device: %s", psz_device );
- }
- else
- {
- /* If no default device has been selected, chose the first one */
- if( !p_aout->output.p_sys->psz_device && p_guid )
- {
- p_aout->output.p_sys->psz_device = strdup( psz_device );
- p_aout->output.p_sys->p_device_guid = malloc( sizeof( GUID ) );
- *p_aout->output.p_sys->p_device_guid = *p_guid;
- msg_Dbg( p_aout, "using device: %s", psz_device );
- }
- }
+ IDirectSoundBuffer_Stop( p_sys->p_dsbuffer );
+ /* release the secondary buffer */
+ DestroyDSBuffer( p_aout );