OSDN Git Service

* fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Move delete of
authorcorinna <corinna>
Fri, 7 May 2004 07:54:28 +0000 (07:54 +0000)
committercorinna <corinna>
Fri, 7 May 2004 07:54:28 +0000 (07:54 +0000)
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.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_dsp.cc

index 6c5d202..20c7419 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-07  Gerd Spalink  <Gerd.Spalink@t-online.de>
+
+       * 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.
+
 2004-05-07  Corinna Vinschen  <corinna@vinschen.de>
 
        Revert code reversion from 2004-04-03.  So, revert to async I/O again.
index a2ddef4..a872c23 100644 (file)
@@ -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;
     }