shithub: sox

Download patch

ref: 8faf57a9681a9e9d86e52bc472c1d9e2ee286ab0
parent: 48ccfcaedc9779a96f8a206cf06fe8f60b779b2a
author: robs <robs>
date: Fri Nov 21 14:08:30 EST 2008

Fix [2028181] w64 float format incompatibility

--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 
   o Slight improvement to A-law/u-law conversion accuracy: round LSB
     instead of truncating.  (robs)
+  o Fix [2028181] w64 float format incompatibility.  (Tim Munro)
 
 Effects:
 
--- a/m4/sndfile.m4
+++ b/m4/sndfile.m4
@@ -55,6 +55,8 @@
     ])
     AC_CHECK_FUNC([sf_open_virtual], AC_DEFINE([HAVE_SNDFILE_1_0_12], 1, [Define if you have libsndfile >= 1.0.12]))
     AC_CHECK_DECL([SF_FORMAT_OGG], AC_DEFINE([HAVE_SNDFILE_1_0_18], 1, [Define if you have libsndfile >= 1.0.18]),, [#include <sndfile.h>])
+    AC_CHECK_DECL([SFC_SET_SCALE_FLOAT_INT_READ], AC_DEFINE([HAVE_SFC_SET_SCALE_FLOAT_INT_READ], 1, [Define if you have libsndfile with SFC_SET_SCALE_FLOAT_INT_READ]),, [#include <sndfile.h>])
+    AC_CHECK_DECL([SFC_SET_SCALE_INT_FLOAT_WRITE], AC_DEFINE([HAVE_SFC_SET_SCALE_INT_FLOAT_WRITE], 1, [Define if you have libsndfile with SFC_SFC_SET_SCALE_INT_FLOAT_WRITE]),, [#include <sndfile.h>])
   ])
   CFLAGS="$ac_save_CFLAGS"
   LIBS="$ac_save_LIBS"
--- a/src/sndfile.c
+++ b/src/sndfile.c
@@ -287,7 +287,7 @@
   }
   else rate = sf->sf_info->samplerate;
 
-#if 0
+#ifdef HAVE_SFC_SET_SCALE_FLOAT_INT_READ
   if ((sf->sf_info->format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT)
     sf_command(sf->sf_file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE);
 #endif
@@ -363,7 +363,7 @@
     return SOX_EOF;
   }
 
-#if 0
+#ifdef HAVE_SFC_SET_SCALE_INT_FLOAT_WRITE
   if ((sf->sf_info->format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT)
     sf_command(sf->sf_file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE);
 #endif