shithub: libsamplerate

Download patch

ref: ece924526fe18b0e292df06b86ca11d112f54a79
parent: 7f461a3cdc62393c84bbad03e7514e597fb89689
author: evpobr <evpobr@gmail.com>
date: Sun Oct 25 07:36:31 EDT 2020

Rename some private structs `reset` field to `dirty`

To avoid confusion with SRC_STATE->reset field.

--- a/src/src_linear.c
+++ b/src/src_linear.c
@@ -28,7 +28,7 @@
 typedef struct
 {	int		linear_magic_marker ;
 	int		channels ;
-	int		reset ;
+	int		dirty ;
 	long	in_count, in_used ;
 	long	out_count, out_gen ;
 	float	last_value [] ;
@@ -51,11 +51,11 @@
 
 	priv = (LINEAR_DATA*) state->private_data ;
 
-	if (priv->reset)
+	if (!priv->dirty)
 	{	/* If we have just been reset, set the last_value data. */
 		for (ch = 0 ; ch < priv->channels ; ch++)
 			priv->last_value [ch] = data->data_in [ch] ;
-		priv->reset = 0 ;
+		priv->dirty = 1 ;
 		} ;
 
 	priv->in_count = data->input_frames * priv->channels ;
@@ -203,7 +203,7 @@
 		return ;
 
 	priv->channels = state->channels ;
-	priv->reset = 1 ;
+	priv->dirty = 0 ;
 	memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
 
 	return ;
--- a/src/src_zoh.c
+++ b/src/src_zoh.c
@@ -26,7 +26,7 @@
 typedef struct
 {	int		zoh_magic_marker ;
 	int		channels ;
-	int		reset ;
+	int		dirty ;
 	long	in_count, in_used ;
 	long	out_count, out_gen ;
 	float	last_value [] ;
@@ -49,11 +49,11 @@
 
 	priv = (ZOH_DATA*) state->private_data ;
 
-	if (priv->reset)
+	if (!priv->dirty)
 	{	/* If we have just been reset, set the last_value data. */
 		for (ch = 0 ; ch < priv->channels ; ch++)
 			priv->last_value [ch] = data->data_in [ch] ;
-		priv->reset = 0 ;
+		priv->dirty = 1 ;
 		} ;
 
 	priv->in_count = data->input_frames * priv->channels ;
@@ -194,7 +194,7 @@
 		return ;
 
 	priv->channels = state->channels ;
-	priv->reset = 1 ;
+	priv->dirty = 0 ;
 	memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
 
 	return ;