shithub: aubio

Download patch

ref: 2434566042c69ea1e64fbe7bef600f3e3474d480
parent: 0f5837d10d4fc8f9d94b6a0591af4743bcbfb5fa
author: Paul Brossier <piem@piem.org>
date: Wed Dec 12 22:36:33 EST 2018

[io] avoid deprecation warning avcodec <= 58.3.102

--- 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 @@
         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