summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia/dsound.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/pjmedia/src/pjmedia/dsound.c b/pjmedia/src/pjmedia/dsound.c
index 36db101d..9e1d7a55 100644
--- a/pjmedia/src/pjmedia/dsound.c
+++ b/pjmedia/src/pjmedia/dsound.c
@@ -882,19 +882,15 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream)
pjmedia_snd_stream_stop(stream);
- if (stream->play_strm.ds.play.lpDsBuffer) {
- IDirectSoundBuffer_Release( stream->play_strm.ds.play.lpDsBuffer );
- stream->play_strm.ds.play.lpDsBuffer = NULL;
- }
-
- if (stream->play_strm.ds.play.lpDs) {
- IDirectSound_Release( stream->play_strm.ds.play.lpDs );
- stream->play_strm.ds.play.lpDs = NULL;
+ if (stream->thread) {
+ stream->thread_quit_flag = 1;
+ pj_thread_join(stream->thread);
+ pj_thread_destroy(stream->thread);
+ stream->thread = NULL;
}
if (stream->play_strm.lpDsNotify) {
- //No need?
- //IDirectSoundNotify_Release( stream->play_strm.lpDsNotify );
+ IDirectSoundNotify_Release( stream->play_strm.lpDsNotify );
stream->play_strm.lpDsNotify = NULL;
}
@@ -903,20 +899,18 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream)
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;
+ if (stream->play_strm.ds.play.lpDsBuffer) {
+ IDirectSoundBuffer_Release( stream->play_strm.ds.play.lpDsBuffer );
+ stream->play_strm.ds.play.lpDsBuffer = NULL;
}
- if (stream->rec_strm.ds.capture.lpDs) {
- IDirectSoundCapture_Release( stream->rec_strm.ds.capture.lpDs );
- stream->rec_strm.ds.capture.lpDs = NULL;
+ if (stream->play_strm.ds.play.lpDs) {
+ IDirectSound_Release( stream->play_strm.ds.play.lpDs );
+ stream->play_strm.ds.play.lpDs = NULL;
}
if (stream->rec_strm.lpDsNotify) {
- //No need?
- //IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify );
+ IDirectSoundNotify_Release( stream->rec_strm.lpDsNotify );
stream->rec_strm.lpDsNotify = NULL;
}
@@ -925,13 +919,17 @@ PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream)
stream->rec_strm.hEvent = NULL;
}
- if (stream->thread) {
- stream->thread_quit_flag = 1;
- pj_thread_join(stream->thread);
- pj_thread_destroy(stream->thread);
- stream->thread = NULL;
+ if (stream->rec_strm.ds.capture.lpDsBuffer) {
+ IDirectSoundCaptureBuffer_Release( stream->rec_strm.ds.capture.lpDsBuffer );
+ stream->rec_strm.ds.capture.lpDsBuffer = NULL;
+ }
+
+ if (stream->rec_strm.ds.capture.lpDs) {
+ IDirectSoundCapture_Release( stream->rec_strm.ds.capture.lpDs );
+ stream->rec_strm.ds.capture.lpDs = NULL;
}
+
pj_pool_release(stream->pool);
return PJ_SUCCESS;