summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libxinevdec/image.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c
index d5a9cfff5..d8064d200 100644
--- a/src/libxinevdec/image.c
+++ b/src/libxinevdec/image.c
@@ -101,14 +101,23 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
/*
* this->image -> rgb data
*/
+#if !defined(MagickLibVersion) || MagickLibVersion < 0x671
InitializeMagick(NULL);
+#else
+ MagickWandGenesis();
+#endif
wand = NewMagickWand();
status = MagickReadImageBlob(wand, this->image, this->index);
+
this->index = 0;
if (!status) {
DestroyMagickWand(wand);
+#if !defined(MagickLibVersion) || MagickLibVersion < 0x671
DestroyMagick();
+#else
+ MagickWandTerminus();
+#endif
lprintf("error loading image\n");
return;
}
@@ -116,9 +125,15 @@ 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
MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
DestroyMagickWand(wand);
DestroyMagick();
+#else
+ MagickExportImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
+ DestroyMagickWand(wand);
+ MagickWandTerminus();
+#endif
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height);