From: Paul Brossier Date: Thu, 13 Dec 2018 02:36:33 +0000 (+0100) Subject: [io] avoid deprecation warning avcodec <= 58.3.102 X-Git-Tag: 0.4.9~112 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=2434566042c69ea1e64fbe7bef600f3e3474d480;p=aubio.git [io] avoid deprecation warning avcodec <= 58.3.102 --- diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 537b6627..247a3452 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -46,6 +46,10 @@ #define HAVE_AUBIO_LIBAVCODEC_DEPRECATED 1 #endif +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,3,102) +#define HAVE_AUBIO_LIBAVCODEC_TIMEBASE_FIX 1 +#endif + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) #warning "libavcodec < 56 is deprecated" #define av_frame_alloc avcodec_alloc_frame @@ -239,7 +243,8 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, av_get_media_type_string(AVMEDIA_TYPE_AUDIO), s->path); goto beach; } -#if FFMPEG_LIBAVFORMAT // deprecated with ffmpeg, required with libav +#if HAVE_AUBIO_LIBAVCODEC_TIMEBASE_FIX + // avoids 'skipped frames warning' with avecodec < 58, deprecated after av_codec_set_pkt_timebase(avCodecCtx, avFormatCtx->streams[selected_stream]->time_base); #endif