From: Paul Brossier Date: Fri, 17 Mar 2017 17:29:12 +0000 (+0100) Subject: src/io/source_avcodec.c: simplify new_ failure recovery X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=99382009a578e37e70317b1e2fe737b90af2ad17;p=aubio.git src/io/source_avcodec.c: simplify new_ failure recovery --- diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 91bb0071..70643147 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -163,7 +163,7 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t sa char errorstr[256]; av_strerror (err, errorstr, sizeof(errorstr)); AUBIO_ERR("source_avcodec: Failed opening %s (%s)\n", s->path, errorstr); - goto beach_streamopts; + goto beach; } // try to make sure max_analyze_duration is big enough for most songs @@ -298,9 +298,8 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t sa av_dict_free(&streamopts); return s; -beach_streamopts: - av_dict_free(&streamopts); beach: + if (streamopts != 0) av_dict_free(&streamopts); //AUBIO_ERR("can not read %s at samplerate %dHz with a hop_size of %d\n", // s->path, s->samplerate, s->hop_size); #ifdef HAVE_AUBIO_AVCODEC_MUTEX