X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_compatibility.cc;h=361fa7423a6704dbc0ff35b91d429c0d2f2922ba;hb=a8ed320d887056ab84dd7068e9a9560d955e416d;hp=bdaf735a21f698eb33732a213f0423c735768d0b;hpb=2525b527f279a130155d40b7ee57057897270915;p=dcpomatic.git diff --git a/src/lib/ffmpeg_compatibility.cc b/src/lib/ffmpeg_compatibility.cc index bdaf735a2..361fa7423 100644 --- a/src/lib/ffmpeg_compatibility.cc +++ b/src/lib/ffmpeg_compatibility.cc @@ -22,7 +22,9 @@ extern "C" { } #include "exceptions.h" -#ifdef DVDOMATIC_FFMPEG_0_8_3 +#include "i18n.h" + +#if LIBAVFILTER_VERSION_MAJOR == 2 && LIBAVFILTER_VERSION_MINOR == 15 typedef struct { enum PixelFormat pix_fmt; @@ -64,16 +66,16 @@ avsink_query_formats (AVFilterContext* ctx) AVFilter* get_sink () { -#ifdef DVDOMATIC_FFMPEG_0_8_3 +#if LIBAVFILTER_VERSION_MAJOR == 2 && LIBAVFILTER_VERSION_MINOR == 15 /* XXX does this leak stuff? */ AVFilter* buffer_sink = new AVFilter; - buffer_sink->name = av_strdup ("avsink"); + buffer_sink->name = av_strdup (N_("avsink")); buffer_sink->priv_size = sizeof (AVSinkContext); buffer_sink->init = avsink_init; buffer_sink->query_formats = avsink_query_formats; buffer_sink->inputs = new AVFilterPad[2]; AVFilterPad* i0 = const_cast (&buffer_sink->inputs[0]); - i0->name = "default"; + i0->name = N_("default"); i0->type = AVMEDIA_TYPE_VIDEO; i0->min_perms = AV_PERM_READ; i0->rej_perms = 0; @@ -91,19 +93,27 @@ get_sink () const_cast (&buffer_sink->outputs[0])->name = 0; return buffer_sink; #else - AVFilter* buffer_sink = avfilter_get_by_name("buffersink"); + AVFilter* buffer_sink = avfilter_get_by_name(N_("buffersink")); if (buffer_sink == 0) { - throw DecodeError ("Could not create buffer sink filter"); + throw DecodeError (N_("Could not create buffer sink filter")); } return buffer_sink; #endif } -#ifdef DVDOMATIC_FFMPEG_0_8_3 +#if LIBAVFILTER_VERSION_MAJOR == 2 && LIBAVFILTER_VERSION_MINOR == 15 AVFilterInOut * avfilter_inout_alloc () { return (AVFilterInOut *) av_malloc (sizeof (AVFilterInOut)); } #endif + +#ifndef HAVE_AV_FRAME_GET_BEST_EFFORT_TIMESTAMP +int64_t av_frame_get_best_effort_timestamp (AVFrame const * f) +{ + return f->best_effort_timestamp; +} + +#endif