Changeset a028a04


Ignore:
Timestamp:
Nov 30, 2016, 7:10:10 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler, yinfft+
Children:
5d9693c
Parents:
22e991b
Message:

src/io/sink_{sndfile,wavwrite}.c: use AUBIO_MAX_CHANNELS, fix error message

Location:
src/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    r22e991b ra028a04  
    3232#include "io/ioutils.h"
    3333
    34 #define MAX_CHANNELS 6
    3534#define MAX_SIZE 4096
    3635
     
    149148  s->scratch_size = s->max_size*s->channels;
    150149  /* allocate data for de/interleaving reallocated when needed. */
    151   if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) {
     150  if (s->scratch_size >= MAX_SIZE * AUBIO_MAX_CHANNELS) {
     151    abort();
    152152    AUBIO_ERR("sink_sndfile: %d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n",
    153         s->max_size, s->channels, MAX_CHANNELS * MAX_CHANNELS);
     153        s->max_size, s->channels, MAX_SIZE * AUBIO_MAX_CHANNELS);
    154154    return AUBIO_FAIL;
    155155  }
  • src/io/sink_wavwrite.c

    r22e991b ra028a04  
    3232#include <errno.h>
    3333
    34 #define MAX_CHANNELS 6
    3534#define MAX_SIZE 4096
    3635
     
    221220  s->scratch_size = s->max_size * s->channels;
    222221  /* allocate data for de/interleaving reallocated when needed. */
    223   if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) {
     222  if (s->scratch_size >= MAX_SIZE * AUBIO_MAX_CHANNELS) {
    224223    AUBIO_ERR("sink_wavwrite: %d x %d exceeds SIZE maximum buffer size %d\n",
    225         s->max_size, s->channels, MAX_SIZE * MAX_CHANNELS);
     224        s->max_size, s->channels, MAX_SIZE * AUBIO_MAX_CHANNELS);
    226225    goto beach;
    227226  }
Note: See TracChangeset for help on using the changeset viewer.