diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | src/libxinevdec/image.c | 17 |
3 files changed, 17 insertions, 4 deletions
@@ -1,5 +1,6 @@ xine-lib (1.1.20.1) 2011-??-?? * Various bug fixes. + * Use the current ImageMagick API (if using ImageMagick). xine-lib (1.1.20) 2011-11-13 * Imagine that there's a large poppy here. diff --git a/configure.ac b/configure.ac index c88bd2592..f18288691 100644 --- a/configure.ac +++ b/configure.ac @@ -1426,11 +1426,12 @@ if test "x$with_imagemagick" != "xno"; then dnl the flags for plain GraphicsMagick WAND_CFLAGS="$GRAPHICSMAGICKWAND_CFLAGS" WAND_LIBS="$GRAPHICSMAGICKWAND_LIBS" + AC_DEFINE([HAVE_GRAPHICSMAGICK], [1], [Define this if you have GraphicsMagick installed]) fi if test "x$with_imagemagick" = "xyes" && test "x$have_imagemagick" = "xno"; then AC_MSG_ERROR([ImageMagick support requested, but neither Wand, MagickWand, nor GraphicsMagick were found]) elif test "x$have_imagemagick" = "xyes"; then - AC_DEFINE([HAVE_WAND], [1], [Define this if you have ImageMagick installed]) + AC_DEFINE([HAVE_WAND], [1], [Define this if you have ImageMagick or GraphicsMagick's compat layer installed]) fi fi diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index d8064d200..5e166382b 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -54,6 +54,17 @@ #include "xineutils.h" #include "bswap.h" +#ifdef HAVE_GRAPHICSMAGICK +# define MAGICK_VERSION 0x670 +#else +# if !defined(MagickLibVersion) || MagickLibVersion < 0x671 +# define MAGICK_VERSION 0x670 +#else +# define MAGICK_VERSION MagickLibVersion +# endif +#endif + + typedef struct { video_decoder_class_t decoder_class; @@ -101,7 +112,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { /* * this->image -> rgb data */ -#if !defined(MagickLibVersion) || MagickLibVersion < 0x671 +#if MAGICK_VERSION < 0x671 InitializeMagick(NULL); #else MagickWandGenesis(); @@ -113,7 +124,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (!status) { DestroyMagickWand(wand); -#if !defined(MagickLibVersion) || MagickLibVersion < 0x671 +#if MAGICK_VERSION < 0x671 DestroyMagick(); #else MagickWandTerminus(); @@ -125,7 +136,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { width = MagickGetImageWidth(wand) & ~1; /* must be even for init_yuv_planes */ height = MagickGetImageHeight(wand); img_buf = malloc(width * height * 3); -#if !defined(MagickLibVersion) || MagickLibVersion < 0x671 +#if MAGICK_VERSION < 0x671 MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf); DestroyMagickWand(wand); DestroyMagick(); |