diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-11-22 20:10:32 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-11-22 20:10:32 +0100 |
commit | 918fb79b58c07c64731baf574b3bec2d57e96a1f (patch) | |
tree | 9aa793cbf1751f102752c9399761136fbd009347 /modules/winwave/play.c | |
parent | 5690e4a0637009cc166dc88e3edf13957d736c4b (diff) |
winwave: call waveOutClose/waveInClose last
Diffstat (limited to 'modules/winwave/play.c')
-rw-r--r-- | modules/winwave/play.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/winwave/play.c b/modules/winwave/play.c index e258561..1ca0d44 100644 --- a/modules/winwave/play.c +++ b/modules/winwave/play.c @@ -20,7 +20,7 @@ struct auplay_st { struct dspbuf bufs[WRITE_BUFFERS]; int pos; HWAVEOUT waveout; - bool rdy; + volatile bool rdy; size_t inuse; auplay_write_h *wh; void *arg; @@ -41,7 +41,7 @@ static void auplay_destructor(void *arg) while (st->inuse > 0) Sleep(50); - waveOutClose(st->waveout); + waveOutReset(st->waveout); for (i = 0; i < WRITE_BUFFERS; i++) { waveOutUnprepareHeader(st->waveout, &st->bufs[i].wh, @@ -49,6 +49,8 @@ static void auplay_destructor(void *arg) mem_deref(st->bufs[i].mb); } + waveOutClose(st->waveout); + mem_deref(st->ap); } |