diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-03-24 08:57:17 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-03-24 08:57:17 +0000 |
commit | a65cfe3c8cee9d8da739b5cc2b9731e21dc627be (patch) | |
tree | ee06a6c78111695ea19e27e50c334912a331f164 /winsup | |
parent | 7810a29372fefc43427a4c7232ae541704306d68 (diff) | |
download | newlib-a65cfe3c8cee9d8da739b5cc2b9731e21dc627be.zip newlib-a65cfe3c8cee9d8da739b5cc2b9731e21dc627be.tar.gz newlib-a65cfe3c8cee9d8da739b5cc2b9731e21dc627be.tar.bz2 |
* 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.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_dsp.cc | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b0f990c..80a503b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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> * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use created diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index 8791a64..b614ede 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -1098,7 +1098,9 @@ fhandler_dev_dsp::open (int flags, mode_t mode) int 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); if (!audio_out_) { @@ -1109,9 +1111,10 @@ fhandler_dev_dsp::write (const void *ptr, size_t len) if (audio_out_->getOwner () == 0L) { // No owner yet, lets do it // 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_)) { // update our format conversion + debug_printf ("=> ptr_s=%08x len_s=%d", ptr_s, len_s); audioformat_ = ((audiobits_ == 8) ? AFMT_U8 : AFMT_S16_LE); 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; } |