- fix .wav file writing again - bad change in one of last commits

This commit is contained in:
Dmytro Bogovych 2019-03-21 14:59:49 +02:00
parent 4dc9e6900a
commit 2492e5dfc4
2 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ using namespace Audio;
// ---------------------- WavFileReader -------------------------
WavFileReader::WavFileReader()
:mHandle(NULL), mRate(0)
:mHandle(nullptr), mRate(0)
{
mDataOffset = 0;
}
@ -166,9 +166,9 @@ void WavFileReader::close()
{
LOCK;
if (NULL != mHandle)
if (nullptr != mHandle)
fclose(mHandle);
mHandle = NULL;
mHandle = nullptr;
}
int WavFileReader::rate() const
@ -246,7 +246,7 @@ unsigned WavFileReader::size() const
#define BITS_PER_CHANNEL 16
WavFileWriter::WavFileWriter()
:mHandle(NULL), mLengthOffset(0), mRate(AUDIO_SAMPLERATE), mChannels(1)
:mHandle(nullptr), mLengthOffset(0), mRate(AUDIO_SAMPLERATE), mChannels(1)
{
}
@ -354,7 +354,7 @@ size_t WavFileWriter::write(const void* buffer, size_t bytes)
// Write file length
fseek(mHandle, 4, SEEK_SET);
size_t fl = mWritten + 36;
int32_t fl = mWritten + 36;
fwrite(&fl, sizeof(fl), 1, mHandle);
// Write data length

View File

@ -57,8 +57,8 @@ namespace Audio
FILE* mHandle; /// Handle of audio file.
std::tstring mFileName; /// Path to requested audio file.
std::recursive_mutex mFileMtx; /// Mutex to protect this instance.
size_t mWritten; /// Amount of written data (in bytes)
size_t mLengthOffset; /// Position of length field.
int mWritten; /// Amount of written data (in bytes)
int mLengthOffset; /// Position of length field.
int mRate,
mChannels;