summaryrefslogtreecommitdiff
path: root/audio/dsoundaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/dsoundaudio.c')
-rw-r--r--audio/dsoundaudio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 63c5a50573..90a0333f13 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -453,13 +453,11 @@ static void dsound_write_sample (HWVoiceOut *hw, uint8_t *dst, int dst_len)
if (src_len1) {
hw->clip (dst, src1, src_len1);
- mixeng_clear (src1, src_len1);
}
if (src_len2) {
dst = advance (dst, src_len1 << hw->info.shift);
hw->clip (dst, src2, src_len2);
- mixeng_clear (src2, src_len2);
}
hw->rpos = pos % hw->samples;
@@ -987,6 +985,12 @@ static void *dsound_audio_init (void)
hr = IDirectSound_Initialize (s->dsound, NULL);
if (FAILED (hr)) {
dsound_logerr (hr, "Could not initialize DirectSound\n");
+
+ hr = IDirectSound_Release (s->dsound);
+ if (FAILED (hr)) {
+ dsound_logerr (hr, "Could not release DirectSound\n");
+ }
+ s->dsound = NULL;
return NULL;
}