From 99382009a578e37e70317b1e2fe737b90af2ad17 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 17 Mar 2017 18:29:12 +0100 Subject: [PATCH] src/io/source_avcodec.c: simplify new_ failure recovery --- src/io/source_avcodec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 2.11.0