Merge branch 'master' into sampler
authorPaul Brossier <piem@piem.org>
Mon, 10 Apr 2017 23:49:44 +0000 (01:49 +0200)
committerPaul Brossier <piem@piem.org>
Mon, 10 Apr 2017 23:49:44 +0000 (01:49 +0200)
Fixed conflicts:
python/lib/gen_external.py
src/io/source_avcodec.c

1  2 
python/lib/gen_external.py
python/lib/moresetuptools.py
src/aubio.h
src/io/source_avcodec.c
wscript

@@@ -37,11 -37,9 +37,11 @@@ skip_objects = 
    'source_sndfile',
    'source_avcodec',
    'source_wavread',
--  #'sampler',
    'audio_unit',
+   'spectral_whitening',
 +  'timestretch', # TODO fix parsing of uint_t *read in _do
 +  'sampler', # TODO fix parsing of uint_t *read in _do
 +  'ringbuffer',
    ]
  
  def get_preprocessor():
Simple merge
diff --cc src/aubio.h
Simple merge
@@@ -116,6 -109,15 +119,16 @@@ uint_t aubio_source_avcodec_has_network
  
  aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t samplerate, uint_t hop_size) {
    aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t);
+   AVFormatContext *avFormatCtx = s->avFormatCtx;
+   AVCodecContext *avCodecCtx = s->avCodecCtx;
+   AVFrame *avFrame = s->avFrame;
++  AVDictionary *streamopts = 0;
+   sint_t selected_stream = -1;
+ #if FF_API_LAVF_AVCTX
+   AVCodecParameters *codecpar;
+ #endif
+   AVCodec *codec;
+   uint_t i;
    int err;
    if (path == NULL) {
      AUBIO_ERR("source_avcodec: Aborted opening null path\n");
    }
  
    // try opening the file and get some info about it
-   AVFormatContext *avFormatCtx = s->avFormatCtx;
-   AVDictionary *streamopts = 0;
 +  if (s->has_network_url) {
 +    if (av_dict_set(&streamopts, "timeout", "1000000", 0)) { // in microseconds
 +      AUBIO_WRN("source_avcodec: Failed setting timeout to 1000000 for %s\n", s->path);
 +    } else {
 +      AUBIO_WRN("source_avcodec: Setting timeout to 1000000 for %s\n", s->path);
 +    }
 +  }
    avFormatCtx = NULL;
 -  if ( (err = avformat_open_input(&avFormatCtx, s->path, NULL, NULL) ) < 0 ) {
 +  if ( (err = avformat_open_input(&avFormatCtx, s->path, NULL, &streamopts) ) < 0 ) {
      char errorstr[256];
      av_strerror (err, errorstr, sizeof(errorstr));
      AUBIO_ERR("source_avcodec: Failed opening %s (%s)\n", s->path, errorstr);
diff --cc wscript
Simple merge