* 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.
This commit is contained in:
Corinna Vinschen 2004-05-07 07:54:28 +00:00
parent 3e101fb2cd
commit 367ff06ea4
2 changed files with 23 additions and 10 deletions

View 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.

View File

@ -457,6 +457,7 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
debug_printf ("waveOutClose rc=%d", rc);
clearOwner ();
}
if (bigwavebuffer_)
{
@ -464,7 +465,6 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
bigwavebuffer_ = NULL;
}
}
}
void
fhandler_dev_dsp::Audio_out::init (unsigned blockSize)
@ -859,6 +859,7 @@ fhandler_dev_dsp::Audio_in::stop ()
debug_printf ("waveInClose rc=%d", rc);
clearOwner ();
}
if (bigwavebuffer_)
{
@ -866,7 +867,6 @@ fhandler_dev_dsp::Audio_in::stop ()
bigwavebuffer_ = NULL;
}
}
}
bool
fhandler_dev_dsp::Audio_in::queueblock (WAVEHDR *pHdr)
@ -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;
}