From: Paul Brossier Date: Fri, 7 Apr 2017 13:16:43 +0000 (+0200) Subject: src/io/source_avcodec.c: avoid double free with libavformat56 X-Git-Tag: 0.4.5~13 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=82502145e3f024648ceb7627150723ea33b6a92e;p=aubio.git src/io/source_avcodec.c: avoid double free with libavformat56 Note: when using ffmpeg 3.2.x, valgrind will complain that `40 bytes in 1 blocks are still reachable`. This is supposedly harmless; for more information see https://trac.ffmpeg.org/ticket/3194. --- diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 02943ded..45aa4188 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -42,9 +42,12 @@ ) // backward compatibility with libavcodec55 -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) -#warning "libavcodec55 is deprecated" +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57,0,0) #define HAVE_AUBIO_LIBAVCODEC_DEPRECATED 1 +#endif + +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) +#warning "libavcodec < 56 is deprecated" #define av_frame_alloc avcodec_alloc_frame #define av_frame_free avcodec_free_frame #define av_packet_unref av_free_packet @@ -574,9 +577,6 @@ uint_t aubio_source_avcodec_close(aubio_source_avcodec_t * s) { s->avCodecCtx = NULL; if (s->avFormatCtx != NULL) { avformat_close_input(&s->avFormatCtx); -#ifndef HAVE_AUBIO_LIBAVCODEC_DEPRECATED // avoid crash on old libavcodec54 - avformat_free_context(s->avFormatCtx); -#endif s->avFormatCtx = NULL; } av_packet_unref(&s->avPacket); diff --git a/this_version.py b/this_version.py index 4629f140..82ed8502 100644 --- a/this_version.py +++ b/this_version.py @@ -1,5 +1,6 @@ #! python import os +import sys __version_info = {} # keep a reference to parse VERSION once @@ -81,18 +82,18 @@ def get_git_revision_hash(short=True): try: gitsha = subprocess.check_output(gitcmd).strip().decode('utf8') except Exception as e: - print('git command error :%s' % e) + sys.stderr.write('git command error :%s\n' % e) return None # check if we have a clean tree gitcmd = ['git', '-C', aubio_dir, 'status', '--porcelain'] try: output = subprocess.check_output(gitcmd).decode('utf8') if len(output): - print('Info: current tree is not clean\n') - print(output) + sys.stderr.write('Info: current tree is not clean\n\n') + sys.stderr.write(output + '\n') gitsha += '+mods' except subprocess.CalledProcessError as e: - print (e) + sys.stderr.write('git command error :%s\n' % e) pass return gitsha