~ubuntu-branches/ubuntu/utopic/muse/utopic

« back to all changes in this revision

Viewing changes to muse/audiotrack.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-01-07 10:27:14 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20130107102714-fajkwjbz02aqupbh
Tags: 2.1-1
* New upstream release.
* Refresh 1001-buildsystem.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <limits.h>
25
25
#include <stdlib.h>
 
26
#include <stdio.h>
26
27
#include <map>
27
28
 
28
29
#include <QMessageBox>
117
118
      _totalOutChannels = MAX_CHANNELS;
118
119
      outBuffers = new float*[_totalOutChannels];
119
120
      for (int i = 0; i < _totalOutChannels; ++i)
120
 
            posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
 
121
      {
 
122
        int rv = posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
 
123
        if(rv != 0)
 
124
        {
 
125
          fprintf(stderr, "ERROR: AudioTrack ctor: posix_memalign returned error:%d. Aborting!\n", rv);
 
126
          abort();
 
127
        }
 
128
      }
121
129
      
122
130
      // This is only set by multi-channel syntis...
123
131
      _totalInChannels = 0;
1725
1733
      for(int i = 0; i < MAX_CHANNELS; ++i)
1726
1734
      {
1727
1735
        if(i < channels())
1728
 
          posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1736
        {
 
1737
          int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1738
          if(rv != 0)
 
1739
          {
 
1740
            fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv);
 
1741
            abort();
 
1742
          }
 
1743
        }
1729
1744
        else
1730
1745
          buffer[i] = 0;
1731
1746
      }
1738
1753
      for(int i = 0; i < MAX_CHANNELS; ++i)
1739
1754
      {
1740
1755
        if(i < channels())
1741
 
          posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1756
        {
 
1757
          int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1758
          if(rv != 0)
 
1759
          {
 
1760
            fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv);
 
1761
            abort();
 
1762
          }
 
1763
        }
1742
1764
        else
1743
1765
          buffer[i] = 0;
1744
1766
      }
1830
1852
  if(n > channels()) 
1831
1853
  {
1832
1854
    for(int i = channels(); i < n; ++i)
1833
 
      posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1855
    {
 
1856
      int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
 
1857
      if(rv != 0)
 
1858
      {
 
1859
        fprintf(stderr, "ERROR: AudioAux::setChannels: posix_memalign returned error:%d. Aborting!\n", rv);
 
1860
        abort();
 
1861
      }
 
1862
    }
1834
1863
  }
1835
1864
  else if(n < channels()) 
1836
1865
  {