#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
s->hop_size = hop_size;
s->channels = 1;
- if (s->path) AUBIO_FREE(s->path);
s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
av_get_media_type_string(AVMEDIA_TYPE_AUDIO), s->path);
goto beach;
}
+#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
+#endif
if ( ( err = avcodec_open2(avCodecCtx, codec, NULL) ) < 0) {
char errorstr[256];
}
void del_aubio_source_avcodec(aubio_source_avcodec_t * s){
- if (!s) return;
+ AUBIO_ASSERT(s);
aubio_source_avcodec_close(s);
if (s->output != NULL) {
av_free(s->output);