shithub: libsamplerate

Download patch

ref: 8e2d37f2c195c6c2e677b87e2bccbe5f2a23a175
parent: e9824f9dbfee589196d69c63f78b27d29c5b4068
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Fri Apr 3 14:24:30 EDT 2009

src/samplerate.h : Move src_ratio field to the start of the SRC_DATA struct to ensure it gets aligned correctly.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-03  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    * src/samplerate.h
+    Move src_ratio field to the start of the SRC_DATA struct to ensure it gets
+    aligned correctly when either the library or client code gets compiled with
+    -malign-double.
+
 2009-02-26  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * Win32/Makefile.msvc
--- a/src/samplerate.h
+++ b/src/samplerate.h
@@ -40,14 +40,14 @@
 
 /* SRC_DATA is used to pass data to src_simple() and src_process(). */
 typedef struct
-{	float	*data_in, *data_out ;
+{	double	src_ratio ;
 
+	float	*data_in, *data_out ;
+
 	long	input_frames, output_frames ;
 	long	input_frames_used, output_frames_gen ;
 
 	int		end_of_input ;
-
-	double	src_ratio ;
 } SRC_DATA ;
 
 /* SRC_CB_DATA is used with callback based API. */