diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-05-07 11:54:28 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-05-07 11:54:28 +0400 |
commit | 367ff06ea458a58c16accb4172629366eb04ac30 (patch) | |
tree | 2e292a50f4213f184b0633f222163ecbb94476da /winsup/cygwin/fhandler_dsp.cc | |
parent | 3e101fb2cd57d46020748deb607c99fd6e5be3bf (diff) |
* fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Move delete of
bigwavebuffer_ so that it is always cleaned, also in child processes.
(fhandler_dev_dsp::Audio_in::stop): Ditto.
(fhandler_dev_dsp::close): Stop audio play immediately in case of
abnormal exit.
Diffstat (limited to 'winsup/cygwin/fhandler_dsp.cc')
-rw-r--r-- | winsup/cygwin/fhandler_dsp.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index a2ddef4f2..a872c231e 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -457,12 +457,12 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately) debug_printf ("waveOutClose rc=%d", rc); clearOwner (); + } - if (bigwavebuffer_) - { - delete[] bigwavebuffer_; - bigwavebuffer_ = NULL; - } + if (bigwavebuffer_) + { + delete[] bigwavebuffer_; + bigwavebuffer_ = NULL; } } @@ -859,12 +859,12 @@ fhandler_dev_dsp::Audio_in::stop () debug_printf ("waveInClose rc=%d", rc); clearOwner (); + } - if (bigwavebuffer_) - { - delete[] bigwavebuffer_; - bigwavebuffer_ = NULL; - } + if (bigwavebuffer_) + { + delete[] bigwavebuffer_; + bigwavebuffer_ = NULL; } } @@ -1207,6 +1207,11 @@ fhandler_dev_dsp::close (void) } if (audio_out_) { + if (exit_state != ES_NOT_EXITING) + { // emergency close due to call to exit() or Ctrl-C: + // do not wait for all pending audio to be played + audio_out_->stop (true); + } delete audio_out_; audio_out_ = NULL; } |