Ignore:
Timestamp:
May 17, 2006 5:15:48 PM (18 years ago)
Author:
bennylp
Message:

Rearrange DirectSound? closing steps to reduce blocking delay

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/dsound.c

    r443 r451  
    751751    pjmedia_snd_stream_stop(stream); 
    752752 
     753    if (stream->play_strm.ds.play.lpDsBuffer) { 
     754        IDirectSoundBuffer_Release( stream->play_strm.ds.play.lpDsBuffer ); 
     755        stream->play_strm.ds.play.lpDsBuffer = NULL; 
     756    } 
     757 
     758    if (stream->play_strm.ds.play.lpDs) { 
     759        IDirectSound_Release( stream->play_strm.ds.play.lpDs ); 
     760        stream->play_strm.ds.play.lpDs = NULL; 
     761    } 
     762 
    753763    if (stream->play_strm.lpDsNotify) { 
    754         IDirectSoundNotify_Release( stream->play_strm.lpDsNotify ); 
     764        //No need? 
     765        //IDirectSoundNotify_Release( stream->play_strm.lpDsNotify ); 
    755766        stream->play_strm.lpDsNotify = NULL; 
    756767    } 
     
    761772    } 
    762773 
    763     if (stream->play_strm.ds.play.lpDsBuffer) { 
    764         IDirectSoundBuffer_Release( stream->play_strm.ds.play.lpDsBuffer ); 
    765         stream->play_strm.ds.play.lpDsBuffer = NULL; 
    766     } 
    767  
    768     if (stream->play_strm.ds.play.lpDs) { 
    769         IDirectSound_Release( stream->play_strm.ds.play.lpDs ); 
    770         stream->play_strm.ds.play.lpDs = NULL; 
     774 
     775    if (stream->rec_strm.ds.capture.lpDsBuffer) { 
     776        IDirectSoundCaptureBuffer_Release( stream->rec_strm.ds.capture.lpDsBuffer ); 
     777        stream->rec_strm.ds.capture.lpDsBuffer = NULL; 
     778    } 
     779 
     780    if (stream->rec_strm.ds.capture.lpDs) { 
     781        IDirectSoundCapture_Release( stream->rec_strm.ds.capture.lpDs ); 
     782        stream->rec_strm.ds.capture.lpDs = NULL; 
    771783    } 
    772784 
    773785    if (stream->rec_strm.lpDsNotify) { 
    774         IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify ); 
     786        //No need? 
     787        //IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify ); 
    775788        stream->rec_strm.lpDsNotify = NULL; 
    776789    } 
     
    779792        CloseHandle(stream->rec_strm.hEvent); 
    780793        stream->rec_strm.hEvent = NULL; 
    781     } 
    782  
    783     if (stream->rec_strm.ds.capture.lpDsBuffer) { 
    784         IDirectSoundCaptureBuffer_Release( stream->rec_strm.ds.capture.lpDsBuffer ); 
    785         stream->rec_strm.ds.capture.lpDsBuffer = NULL; 
    786     } 
    787  
    788     if (stream->rec_strm.ds.capture.lpDs) { 
    789         IDirectSoundCapture_Release( stream->rec_strm.ds.capture.lpDs ); 
    790         stream->rec_strm.ds.capture.lpDs = NULL; 
    791794    } 
    792795 
Note: See TracChangeset for help on using the changeset viewer.