History

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

To avoid confusion with SRC_STATE->reset field.

evpobr committed 6 years ago

Commit ece92451 parent 7f461a32 files · +8 −8Browse files

Unified · Split

2 files
  1. src/src_linear.c +4 −4
  2. src/src_zoh.c +4 −4
src/src_linear.c+4−4
@@ -28,7 +28,7 @@ static int linear_copy (SRC_STATE *from, SRC_STATE *to) ; · 27 unmodified lines
28typedef struct28typedef struct
29{ int linear_magic_marker ;29{ int linear_magic_marker ;
30 int channels ;30 int channels ;
31 int reset ;31 int dirty ;
32 long in_count, in_used ;32 long in_count, in_used ;
33 long out_count, out_gen ;33 long out_count, out_gen ;
34 float last_value [] ;34 float last_value [] ;
@@ -51,11 +51,11 @@ linear_vari_process (SRC_STATE *state, SRC_DATA *data) · 16 unmodified lines
51 51
52 priv = (LINEAR_DATA*) state->private_data ;52 priv = (LINEAR_DATA*) state->private_data ;
53 53
54 if (priv->reset)54 if (!priv->dirty)
55 { /* If we have just been reset, set the last_value data. */55 { /* If we have just been reset, set the last_value data. */
56 for (ch = 0 ; ch < priv->channels ; ch++)56 for (ch = 0 ; ch < priv->channels ; ch++)
57 priv->last_value [ch] = data->data_in [ch] ;57 priv->last_value [ch] = data->data_in [ch] ;
58 priv->reset = 0 ;58 priv->dirty = 1 ;
59 } ;59 } ;
60 60
61 priv->in_count = data->input_frames * priv->channels ;61 priv->in_count = data->input_frames * priv->channels ;
@@ -203,7 +203,7 @@ linear_reset (SRC_STATE *state) · 141 unmodified lines
203 return ;203 return ;
204 204
205 priv->channels = state->channels ;205 priv->channels = state->channels ;
206 priv->reset = 1 ;206 priv->dirty = 0 ;
207 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;207 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
208 208
209 return ;209 return ;
src/src_zoh.c+4−4
@@ -26,7 +26,7 @@ static int zoh_copy (SRC_STATE *from, SRC_STATE *to) ; · 25 unmodified lines
26typedef struct26typedef struct
27{ int zoh_magic_marker ;27{ int zoh_magic_marker ;
28 int channels ;28 int channels ;
29 int reset ;29 int dirty ;
30 long in_count, in_used ;30 long in_count, in_used ;
31 long out_count, out_gen ;31 long out_count, out_gen ;
32 float last_value [] ;32 float last_value [] ;
@@ -49,11 +49,11 @@ zoh_vari_process (SRC_STATE *state, SRC_DATA *data) · 16 unmodified lines
49 49
50 priv = (ZOH_DATA*) state->private_data ;50 priv = (ZOH_DATA*) state->private_data ;
51 51
52 if (priv->reset)52 if (!priv->dirty)
53 { /* If we have just been reset, set the last_value data. */53 { /* If we have just been reset, set the last_value data. */
54 for (ch = 0 ; ch < priv->channels ; ch++)54 for (ch = 0 ; ch < priv->channels ; ch++)
55 priv->last_value [ch] = data->data_in [ch] ;55 priv->last_value [ch] = data->data_in [ch] ;
56 priv->reset = 0 ;56 priv->dirty = 1 ;
57 } ;57 } ;
58 58
59 priv->in_count = data->input_frames * priv->channels ;59 priv->in_count = data->input_frames * priv->channels ;
@@ -194,7 +194,7 @@ zoh_reset (SRC_STATE *state) · 134 unmodified lines
194 return ;194 return ;
195 195
196 priv->channels = state->channels ;196 priv->channels = state->channels ;
197 priv->reset = 1 ;197 priv->dirty = 0 ;
198 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;198 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
199 199
200 return ;200 return ;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t