FS-5568 --resolve the real problem is that L=-1 is not valid because the L param is about how many times to generate the output while generating the tone so -1 is impossible because it can never end to let you hear it. The real fix is to not allow -1 loops=-1 is the correct way to do this because that is parsed after the tone is generated and repeats the entire thing. Doing something like L=100 actually generates the whole slinear audio 100 times into memore where loops=100 only generates the little snippet and repeats it after it was generated.
This commit is contained in:
parent
a0043b8ca2
commit
d2a2e4ce15
|
@ -382,9 +382,12 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
break;
|
||||
case 'L':
|
||||
if (!LOOPING) {
|
||||
ts->LOOPS = atoi(cur + 2);
|
||||
int L;
|
||||
if ((L = atoi(cur + 2)) > 0) {
|
||||
ts->LOOPS = L;
|
||||
LOOPING++;
|
||||
}
|
||||
}
|
||||
LOOPING++;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -480,6 +483,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
bottom:
|
||||
free(data);
|
||||
data = NULL;
|
||||
|
||||
if (ts->LOOPS > 0) {
|
||||
ts->LOOPS--;
|
||||
}
|
||||
|
|
|
@ -382,9 +382,12 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
break;
|
||||
case 'L':
|
||||
if (!LOOPING) {
|
||||
ts->LOOPS = atoi(cur + 2);
|
||||
int L;
|
||||
if ((L = atoi(cur + 2)) > 0) {
|
||||
ts->LOOPS = L;
|
||||
LOOPING++;
|
||||
}
|
||||
}
|
||||
LOOPING++;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -480,6 +483,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
bottom:
|
||||
free(data);
|
||||
data = NULL;
|
||||
|
||||
if (ts->LOOPS > 0) {
|
||||
ts->LOOPS--;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue