summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2021-12-13 17:39:44 +0100
committerGaël Bonithon <gael@xfce.org>2021-12-13 18:06:27 +0100
commitd82e509551db98ff70e47d1990f759948ee7fecd (patch)
tree3b97d5ef364aa36c5e5fe7e0931c427f50cabc10
parent1de05df20d52fb45e3c06e1d5ff36984341cb55d (diff)
downloadtumbler-d82e509551db98ff70e47d1990f759948ee7fecd.tar.gz
ffmpeg-thumbnailer: Fix deprecation warning
-rw-r--r--acinclude.m414
-rw-r--r--plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c10
2 files changed, 23 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 360a8ce..30b2ac9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -118,7 +118,19 @@ if test x"$ac_tumbler_ffmpeg_thumbnailer" = x"yes"; then
PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.14],
[
dnl Check for libffmpegthumbnailer
- PKG_CHECK_MODULES([FFMPEGTHUMBNAILER], [libffmpegthumbnailer >= 2.0.0], [], [ac_tumbler_ffmpeg_thumbnailer=no])
+ FFMPEG_REQUIRED_VERSION="2.0.0"
+ PKG_CHECK_MODULES([FFMPEGTHUMBNAILER], [libffmpegthumbnailer >= $FFMPEG_REQUIRED_VERSION], [
+ dnl To build our own CHECK_VERSION, not provided at least until 2.2.2
+ FFMPEG_VERSION=$($PKG_CONFIG --modversion libffmpegthumbnailer)
+ echo "$FFMPEG_VERSION" | $EGREP ['^[0-9]+\.[0-9]+\.[0-9]+$'] >/dev/null || FFMPEG_VERSION=$FFMPEG_REQUIRED_VERSION
+ FFMPEG_MAJOR_VERSION=${FFMPEG_VERSION%%.*}
+ FFMPEG_MICRO_VERSION=${FFMPEG_VERSION##*.}
+ FFMPEG_MINOR_VERSION=${FFMPEG_VERSION#*.}
+ FFMPEG_MINOR_VERSION=${FFMPEG_MINOR_VERSION%.*}
+ AC_DEFINE_UNQUOTED([TUMBLER_FFMPEG_MAJOR_VERSION], [$FFMPEG_MAJOR_VERSION], [For libffmpegthumbnailer version check])
+ AC_DEFINE_UNQUOTED([TUMBLER_FFMPEG_MINOR_VERSION], [$FFMPEG_MINOR_VERSION], [For libffmpegthumbnailer version check])
+ AC_DEFINE_UNQUOTED([TUMBLER_FFMPEG_MICRO_VERSION], [$FFMPEG_MICRO_VERSION], [For libffmpegthumbnailer version check])
+ ], [ac_tumbler_ffmpeg_thumbnailer=no])
], [ac_tumbler_ffmpeg_thumbnailer=no])
fi
diff --git a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c
index 8ada5ef..a361d1f 100644
--- a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c
+++ b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer.c
@@ -38,6 +38,12 @@
#include <ffmpeg-thumbnailer/ffmpeg-thumbnailer.h>
+#define TUMBLER_FFMPEG_CHECK_VERSION(major, minor, micro) \
+ (TUMBLER_FFMPEG_MAJOR_VERSION > (major) || \
+ (TUMBLER_FFMPEG_MAJOR_VERSION == (major) && TUMBLER_FFMPEG_MINOR_VERSION > (minor)) || \
+ (TUMBLER_FFMPEG_MAJOR_VERSION == (major) && TUMBLER_FFMPEG_MINOR_VERSION == (minor) && \
+ TUMBLER_FFMPEG_MICRO_VERSION >= (micro)))
+
static void ffmpeg_thumbnailer_finalize (GObject *object);
static void ffmpeg_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
GCancellable *cancellable,
@@ -199,7 +205,11 @@ ffmpeg_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
g_object_unref (flavor);
/* prepare the video thumbnailer */
+#if TUMBLER_FFMPEG_CHECK_VERSION (2, 2, 1)
+ video_thumbnailer_set_size (ffmpeg_thumbnailer->video, dest_width, dest_height);
+#else
ffmpeg_thumbnailer->video->thumbnail_size = MAX (dest_width, dest_height);
+#endif
v_data = video_thumbnailer_create_image_data ();
uri = tumbler_file_info_get_uri (info);