diff options
-rw-r--r-- | pjmedia/src/pjmedia/dsound.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/pjmedia/src/pjmedia/dsound.c b/pjmedia/src/pjmedia/dsound.c index c80dbad0..700f3612 100644 --- a/pjmedia/src/pjmedia/dsound.c +++ b/pjmedia/src/pjmedia/dsound.c @@ -750,16 +750,6 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) pjmedia_snd_stream_stop(stream); - if (stream->play_strm.lpDsNotify) { - IDirectSoundNotify_Release( stream->play_strm.lpDsNotify ); - stream->play_strm.lpDsNotify = NULL; - } - - if (stream->play_strm.hEvent) { - CloseHandle(stream->play_strm.hEvent); - stream->play_strm.hEvent = NULL; - } - if (stream->play_strm.ds.play.lpDsBuffer) { IDirectSoundBuffer_Release( stream->play_strm.ds.play.lpDsBuffer ); stream->play_strm.ds.play.lpDsBuffer = NULL; @@ -770,16 +760,18 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) stream->play_strm.ds.play.lpDs = NULL; } - if (stream->rec_strm.lpDsNotify) { - IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify ); - stream->rec_strm.lpDsNotify = NULL; + if (stream->play_strm.lpDsNotify) { + //No need? + //IDirectSoundNotify_Release( stream->play_strm.lpDsNotify ); + stream->play_strm.lpDsNotify = NULL; } - if (stream->rec_strm.hEvent) { - CloseHandle(stream->rec_strm.hEvent); - stream->rec_strm.hEvent = NULL; + if (stream->play_strm.hEvent) { + CloseHandle(stream->play_strm.hEvent); + stream->play_strm.hEvent = NULL; } + if (stream->rec_strm.ds.capture.lpDsBuffer) { IDirectSoundCaptureBuffer_Release( stream->rec_strm.ds.capture.lpDsBuffer ); stream->rec_strm.ds.capture.lpDsBuffer = NULL; @@ -790,6 +782,17 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) stream->rec_strm.ds.capture.lpDs = NULL; } + if (stream->rec_strm.lpDsNotify) { + //No need? + //IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify ); + stream->rec_strm.lpDsNotify = NULL; + } + + if (stream->rec_strm.hEvent) { + CloseHandle(stream->rec_strm.hEvent); + stream->rec_strm.hEvent = NULL; + } + if (stream->thread) { stream->thread_quit_flag = 1; pj_thread_join(stream->thread); |