From: Paul Brossier Date: Mon, 10 Apr 2017 23:49:44 +0000 (+0200) Subject: Merge branch 'master' into sampler X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=b201912e58690396bd9cadce7c107944f8553e66;p=aubio.git Merge branch 'master' into sampler Fixed conflicts: python/lib/gen_external.py src/io/source_avcodec.c --- b201912e58690396bd9cadce7c107944f8553e66 diff --cc python/lib/gen_external.py index 85cf839d,c1c69bd7..9d6488a7 --- a/python/lib/gen_external.py +++ b/python/lib/gen_external.py @@@ -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(): diff --cc src/io/source_avcodec.c index 8e3f6d45,0598260f..6b32f157 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@@ -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"); @@@ -149,17 -147,8 +162,15 @@@ } // 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);