diff options
author | Tim E. Real <termtech@rogers.com> | 2012-12-16 01:56:25 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2012-12-16 01:56:25 +0000 |
commit | a2ae7e06099f1ceb38d752909e3c17055fbc59ca (patch) | |
tree | 05d72e62dc981f60876eae6be24993d336276b0f /muse2/muse/audiotrack.cpp | |
parent | b776676ee0feb412a0c2aa917847231985b32563 (diff) |
Fix some Release build warnings. Several more to do.
Diffstat (limited to 'muse2/muse/audiotrack.cpp')
-rw-r--r-- | muse2/muse/audiotrack.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp index 91b07063..0b1e94b2 100644 --- a/muse2/muse/audiotrack.cpp +++ b/muse2/muse/audiotrack.cpp @@ -23,6 +23,7 @@ #include <limits.h> #include <stdlib.h> +#include <stdio.h> #include <map> #include <QMessageBox> @@ -117,7 +118,14 @@ AudioTrack::AudioTrack(TrackType t) _totalOutChannels = MAX_CHANNELS; outBuffers = new float*[_totalOutChannels]; for (int i = 0; i < _totalOutChannels; ++i) - posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize); + { + int rv = posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize); + if(rv != 0) + { + fprintf(stderr, "ERROR: AudioTrack ctor: posix_memalign returned error:%d. Aborting!\n", rv); + abort(); + } + } // This is only set by multi-channel syntis... _totalInChannels = 0; @@ -1725,7 +1733,14 @@ AudioAux::AudioAux() for(int i = 0; i < MAX_CHANNELS; ++i) { if(i < channels()) - posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + { + int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + if(rv != 0) + { + fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv); + abort(); + } + } else buffer[i] = 0; } @@ -1738,7 +1753,14 @@ AudioAux::AudioAux(const AudioAux& t, int flags) for(int i = 0; i < MAX_CHANNELS; ++i) { if(i < channels()) - posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + { + int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + if(rv != 0) + { + fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv); + abort(); + } + } else buffer[i] = 0; } @@ -1830,7 +1852,14 @@ void AudioAux::setChannels(int n) if(n > channels()) { for(int i = channels(); i < n; ++i) - posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + { + int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize); + if(rv != 0) + { + fprintf(stderr, "ERROR: AudioAux::setChannels: posix_memalign returned error:%d. Aborting!\n", rv); + abort(); + } + } } else if(n < channels()) { |