History

--guard, & associated changes

robs committed 17 years ago

Commit 1f70a301 parent bd403cd74 files · +628 −719Browse files

Showing the changes to src/spectrogram.c (1 of 74 files). Show all

Unified · Split

src/spectrogram.c+3−4
@@ -186,21 +186,20 @@ static int flow(sox_effect_t * effp, · 185 unmodified lines
186 size_t * isamp, size_t * osamp)186 size_t * isamp, size_t * osamp)
187{187{
188 priv_t * p = (priv_t *)effp->priv;188 priv_t * p = (priv_t *)effp->priv;
189 size_t len = min(*isamp, *osamp), dummy = 0; /* No need to clip count */189 size_t len = min(*isamp, *osamp);
190 int i;190 int i;
191 191
192 memcpy(obuf, ibuf, len * sizeof(*obuf)); /* Pass on audio unaffected */192 memcpy(obuf, ibuf, len * sizeof(*obuf)); /* Pass on audio unaffected */
193 *isamp = *osamp = len;193 *isamp = *osamp = len;
194 194
195 while (sox_true) {195 while (sox_true) {
196 SOX_SAMPLE_LOCALS;
197 if (p->read == p->step_size) {196 if (p->read == p->step_size) {
198 memmove(p->buf, p->buf + p->step_size,197 memmove(p->buf, p->buf + p->step_size,
199 (p->dft_size - p->step_size) * sizeof(*p->buf));198 (p->dft_size - p->step_size) * sizeof(*p->buf));
200 p->read = 0;199 p->read = 0;
201 }200 }
202 for (; len && p->read < p->step_size; --len, ++p->read, --p->end)201 for (; len && p->read < p->step_size; --len, ++p->read, --p->end)
203 p->buf[p->dft_size - p->step_size + p->read] = FROM_SOX(*ibuf++, dummy);202 p->buf[p->dft_size - p->step_size + p->read] = FROM_SOX(*ibuf++);
204 if (p->read != p->step_size)203 if (p->read != p->step_size)
205 break;204 break;
206 205
@@ -494,7 +493,7 @@ static int stop(sox_effect_t * effp) · 287 unmodified lines
494sox_effect_handler_t const * sox_spectrogram_effect_fn(void)493sox_effect_handler_t const * sox_spectrogram_effect_fn(void)
495{494{
496 static sox_effect_handler_t handler = {495 static sox_effect_handler_t handler = {
497 "spectrogram", 0, 0, getopts, start, flow, drain, stop, 0, sizeof(priv_t)};496 "spectrogram", 0, SOX_EFF_MODIFY, getopts, start, flow, drain, stop, 0, sizeof(priv_t)};
498 static char const * lines[] = {497 static char const * lines[] = {
499 "[options]",498 "[options]",
500 "\t-x num\tX-axis pixels/second, default 100",499 "\t-x num\tX-axis pixels/second, default 100",

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