diff options
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | ext/libpng/gstpngdec.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 3aaa27d51..69ae3d10b 100644 --- a/configure.ac +++ b/configure.ac @@ -701,6 +701,11 @@ dnl *** libpng *** translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true) AG_GST_CHECK_FEATURE(LIBPNG, [Portable Network Graphics library], png, [ AG_GST_PKG_CHECK_MODULES(LIBPNG, libpng >= 1.2) + if test $HAVE_LIBPNG = "yes"; then + PKG_CHECK_MODULES(LIBPNG, libpng >= 1.5.1, [ + AC_DEFINE(HAVE_LIBPNG_1_5, 1, [Defined if libpng version is 1.5.1 or newer]) + ], [true]) + fi ]) dnl *** mpg123 *** diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c index acadf5437..581e3a9f4 100644 --- a/ext/libpng/gstpngdec.c +++ b/ext/libpng/gstpngdec.c @@ -341,7 +341,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec) } gst_video_codec_state_unref (pngdec->output_state); } - +#ifdef HAVE_LIBPNG_1_5 if ((pngdec->color_type & PNG_COLOR_MASK_COLOR) && !(pngdec->color_type & PNG_COLOR_MASK_PALETTE) && png_get_valid (pngdec->png, pngdec->info, PNG_INFO_iCCP)) { @@ -386,6 +386,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec) gst_tag_list_unref (taglist); } } +#endif pngdec->output_state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (pngdec), format, |