* fhandler_dsp.cc (fhandler_dev_dsp::write): Remove type

cast from argument to audio_out_->parsewav() to make reference
	work properly. Now .wav file headers are properly discarded.
This commit is contained in:
Corinna Vinschen 2004-03-24 08:57:17 +00:00
parent 7810a29372
commit a65cfe3c8c
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2004-03-23 Gerd Spalink <Gerd.Spalink@t-online.de>
* fhandler_dsp.cc (fhandler_dev_dsp::write): Remove type
cast from argument to audio_out_->parsewav() to make reference
work properly. Now .wav file headers are properly discarded.
2004-03-23 Corinna Vinschen <corinna@vinschen.de> 2004-03-23 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::fstat_fs): Use created * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use created

View File

@ -1099,6 +1099,8 @@ int
fhandler_dev_dsp::write (const void *ptr, size_t len) fhandler_dev_dsp::write (const void *ptr, size_t len)
{ {
int len_s = len; int len_s = len;
const char *ptr_s = static_cast <const char *> (ptr);
debug_printf ("ptr=%08x len=%d", ptr, len); debug_printf ("ptr=%08x len=%d", ptr, len);
if (!audio_out_) if (!audio_out_)
{ {
@ -1109,9 +1111,10 @@ fhandler_dev_dsp::write (const void *ptr, size_t len)
if (audio_out_->getOwner () == 0L) if (audio_out_->getOwner () == 0L)
{ // No owner yet, lets do it { // No owner yet, lets do it
// check for wave file & get parameters & skip header if possible. // check for wave file & get parameters & skip header if possible.
if (audio_out_->parsewav ((const char *) ptr, len_s, if (audio_out_->parsewav (ptr_s, len_s,
audiofreq_, audiobits_, audiochannels_)) audiofreq_, audiobits_, audiochannels_))
{ // update our format conversion { // update our format conversion
debug_printf ("=> ptr_s=%08x len_s=%d", ptr_s, len_s);
audioformat_ = ((audiobits_ == 8) ? AFMT_U8 : AFMT_S16_LE); audioformat_ = ((audiobits_ == 8) ? AFMT_U8 : AFMT_S16_LE);
audio_out_->setformat (audioformat_); audio_out_->setformat (audioformat_);
} }
@ -1123,7 +1126,7 @@ fhandler_dev_dsp::write (const void *ptr, size_t len)
} }
} }
audio_out_->write ((char *)ptr, len_s); audio_out_->write (ptr_s, len_s);
return len; return len;
} }