Changeset 2de7cfa for src/io/sink.c


Ignore:
Timestamp:
Dec 13, 2018, 2:42:24 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
d013a93
Parents:
1a30c43
Message:

[sink] search extension once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink.c

    r1a30c43 r2de7cfa  
    102102aubio_sink_t * new_aubio_sink(const char_t * uri, uint_t samplerate) {
    103103  aubio_sink_t * s = AUBIO_NEW(aubio_sink_t);
     104#if defined(HAVE_VORBISENC) || defined(HAVE_FLAC)
     105  const char_t * uri_ext = aubio_get_extension(uri);
     106#endif /* defined(HAVE_VORBISENC) || defined(HAVE_FLAC) */
    104107
    105108#ifdef HAVE_VORBISENC
    106109  // check if this uri could be for us
    107110  uint_t match_oggstream = 0;
    108   if (strcmp (aubio_get_extension(uri), "ogg") == 0) match_oggstream = 1;
     111  if (strcmp (uri_ext, "ogg") == 0) match_oggstream = 1;
    109112  if (match_oggstream) {
    110113    s->sink = (void *)new_aubio_sink_vorbis(uri, samplerate);
     
    126129  // check if this uri could be for us
    127130  uint_t match_flacstream = 0;
    128   if (strcmp (aubio_get_extension(uri), "flac") == 0) match_flacstream = 1;
     131  if (strcmp (uri_ext, "flac") == 0) match_flacstream = 1;
    129132  if (match_flacstream) {
    130133    s->sink = (void *)new_aubio_sink_flac(uri, samplerate);
     
    187190#if !defined(HAVE_WAVWRITE) && \
    188191  !defined(HAVE_SNDFILE) && \
    189   !defined(HAVE_SINK_APPLE_AUDIO)
     192  !defined(HAVE_SINK_APPLE_AUDIO) && \
     193  !defined(HAVE_VORBISENC) && \
     194  !defined(HAVE_FLAC)
    190195  AUBIO_ERROR("sink: failed creating '%s' at %dHz (no sink built-in)\n", uri, samplerate);
    191196#endif
Note: See TracChangeset for help on using the changeset viewer.