configure: Add check for log2
Adds check for log2 and only use it in exif library if it is available.
This commit is contained in:
parent
4915090e01
commit
aa3abae744
@ -219,6 +219,10 @@ dnl *** checks for functions ***
|
|||||||
AC_CHECK_FUNCS([localtime_r gmtime_r])
|
AC_CHECK_FUNCS([localtime_r gmtime_r])
|
||||||
|
|
||||||
dnl *** checks for math functions ***
|
dnl *** checks for math functions ***
|
||||||
|
LIBS_SAVE=$LIBS
|
||||||
|
LIBS="$LIBS $LIBM"
|
||||||
|
AC_CHECK_FUNCS(log2)
|
||||||
|
LIBS=$LIBS_SAVE
|
||||||
|
|
||||||
dnl *** checks for types/defines ***
|
dnl *** checks for types/defines ***
|
||||||
|
|
||||||
|
@ -2210,7 +2210,11 @@ serialize_shutter_speed (GstExifWriter * writer, const GstTagList * taglist,
|
|||||||
gst_util_fraction_to_double (gst_value_get_fraction_numerator (value),
|
gst_util_fraction_to_double (gst_value_get_fraction_numerator (value),
|
||||||
gst_value_get_fraction_denominator (value), &num);
|
gst_value_get_fraction_denominator (value), &num);
|
||||||
|
|
||||||
|
#ifdef HAVE_LOG2
|
||||||
num = -log2 (num);
|
num = -log2 (num);
|
||||||
|
#else
|
||||||
|
num = -log (num) / M_LN2;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* now the value */
|
/* now the value */
|
||||||
gst_exif_writer_write_signed_rational_tag_from_double (writer,
|
gst_exif_writer_write_signed_rational_tag_from_double (writer,
|
||||||
@ -2256,7 +2260,11 @@ serialize_aperture_value (GstExifWriter * writer, const GstTagList * taglist,
|
|||||||
GST_WARNING ("Failed to get focal ratio from from tag list");
|
GST_WARNING ("Failed to get focal ratio from from tag list");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_LOG2
|
||||||
num = 2 * log2 (num);
|
num = 2 * log2 (num);
|
||||||
|
#else
|
||||||
|
num = 2 * (log (num) / M_LN2);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* now the value */
|
/* now the value */
|
||||||
gst_exif_writer_write_rational_tag_from_double (writer,
|
gst_exif_writer_write_rational_tag_from_double (writer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user