Skip to content
  • Ludovic Fauvet's avatar
    directsound: remove broken notification support · a80fee5d
    Ludovic Fauvet authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
    
    
    The original code was non-working because the notication was never
    setup correctly and resulted in a DSERR_INVALIDCALL. A proper fix
    would look like:
    
             if( sys->p_notify )
             {
    +            IDirectSoundBuffer_Stop( aout->sys->p_dsbuffer );
                 DSBPOSITIONNOTIFY notif = {.dwOffset = aout->sys->i_write, .hEventNotify = sys->hnotify_evt } ;
                 if( IDirectSoundNotify_SetNotificationPositions( sys->p_notify, 1, &notif ) ==  DS_OK )
                 {
    +                IDirectSoundBuffer_Play( aout->sys->p_dsbuffer, 0, 0, DSBPLAY_LOOPING );
                     WaitForSingleObject( sys->hnotify_evt, INFINITE );
                     IDirectSoundBuffer_Stop( aout->sys->p_dsbuffer );
                 }
    
    But fixing it makes the problem worse since the notification is setup
    too late and thus the buffer will replay a full loop of the back
    buffer during a drain.
    
    Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
    a80fee5d