pngdec: fix build with libpng versions between 1.2 and 1.5.1

https://bugzilla.gnome.org/show_bug.cgi?id=765927
This commit is contained in:
Andreas Frisch 2017-10-19 18:23:34 +02:00 committed by Sebastian Dröge
parent 9fd988170a
commit 5615ec59c4
2 changed files with 7 additions and 1 deletions

View file

@ -701,6 +701,11 @@ dnl *** libpng ***
translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true) translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
AG_GST_CHECK_FEATURE(LIBPNG, [Portable Network Graphics library], png, [ AG_GST_CHECK_FEATURE(LIBPNG, [Portable Network Graphics library], png, [
AG_GST_PKG_CHECK_MODULES(LIBPNG, libpng >= 1.2) 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 *** dnl *** mpg123 ***

View file

@ -341,7 +341,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec)
} }
gst_video_codec_state_unref (pngdec->output_state); gst_video_codec_state_unref (pngdec->output_state);
} }
#ifdef HAVE_LIBPNG_1_5
if ((pngdec->color_type & PNG_COLOR_MASK_COLOR) if ((pngdec->color_type & PNG_COLOR_MASK_COLOR)
&& !(pngdec->color_type & PNG_COLOR_MASK_PALETTE) && !(pngdec->color_type & PNG_COLOR_MASK_PALETTE)
&& png_get_valid (pngdec->png, pngdec->info, PNG_INFO_iCCP)) { && 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); gst_tag_list_unref (taglist);
} }
} }
#endif
pngdec->output_state = pngdec->output_state =
gst_video_decoder_set_output_state (GST_VIDEO_DECODER (pngdec), format, gst_video_decoder_set_output_state (GST_VIDEO_DECODER (pngdec), format,