Ignore:
Timestamp:
Mar 12, 2017, 11:26:24 AM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Children:
bde49c4a
Parents:
71f2e5f (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge 'origin/master' into sampler

Conflicts:

.travis.yml
Makefile
examples/aubionotes.c
examples/parse_args.h
python/demos/demo_timestretch_online.py
python/lib/moresetuptools.py
python/tests/test_source.py
setup.py
src/io/source.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_apple_audio.c

    r71f2e5f r41b985f  
    1919*/
    2020
    21 #include "config.h"
     21#include "aubio_priv.h"
    2222
    2323#ifdef HAVE_SINK_APPLE_AUDIO
    24 
    25 #include "aubio_priv.h"
    2624#include "fvec.h"
    2725#include "fmat.h"
    2826#include "io/sink_apple_audio.h"
     27#include "io/ioutils.h"
    2928
    3029// CFURLRef, CFURLCreateWithFileSystemPath, ...
     
    6362  s->async = false;
    6463
    65   if (uri == NULL) {
     64  if ( (uri == NULL) || (strlen(uri) < 1) ) {
    6665    AUBIO_ERROR("sink_apple_audio: Aborted opening null path\n");
    6766    goto beach;
     
    7473  s->channels = 0;
    7574
    76   // negative samplerate given, abort
    77   if ((sint_t)samplerate < 0) goto beach;
    7875  // zero samplerate given. do not open yet
    79   if ((sint_t)samplerate == 0) return s;
     76  if ((sint_t)samplerate == 0) {
     77    return s;
     78  }
     79  // invalid samplerate given, abort
     80  if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) {
     81    goto beach;
     82  }
    8083
    8184  s->samplerate = samplerate;
     
    9598uint_t aubio_sink_apple_audio_preset_samplerate(aubio_sink_apple_audio_t *s, uint_t samplerate)
    9699{
    97   if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL;
     100  if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) {
     101    return AUBIO_FAIL;
     102  }
    98103  s->samplerate = samplerate;
    99104  // automatically open when both samplerate and channels have been set
     
    106111uint_t aubio_sink_apple_audio_preset_channels(aubio_sink_apple_audio_t *s, uint_t channels)
    107112{
    108   if ((sint_t)(channels) <= 0) return AUBIO_FAIL;
     113  if (aubio_io_validate_channels("sink_apple_audio", s->path, channels)) {
     114    return AUBIO_FAIL;
     115  }
    109116  s->channels = channels;
    110117  // automatically open when both samplerate and channels have been set
Note: See TracChangeset for help on using the changeset viewer.