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;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
if (!LOOPING) {
|
if (!LOOPING) {
|
||||||
ts->LOOPS = atoi(cur + 2);
|
int L;
|
||||||
|
if ((L = atoi(cur + 2)) > 0) {
|
||||||
|
ts->LOOPS = L;
|
||||||
|
LOOPING++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
LOOPING++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -480,6 +483,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
||||||
bottom:
|
bottom:
|
||||||
free(data);
|
free(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
if (ts->LOOPS > 0) {
|
if (ts->LOOPS > 0) {
|
||||||
ts->LOOPS--;
|
ts->LOOPS--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,9 +382,12 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
if (!LOOPING) {
|
if (!LOOPING) {
|
||||||
ts->LOOPS = atoi(cur + 2);
|
int L;
|
||||||
|
if ((L = atoi(cur + 2)) > 0) {
|
||||||
|
ts->LOOPS = L;
|
||||||
|
LOOPING++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
LOOPING++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -480,6 +483,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
||||||
bottom:
|
bottom:
|
||||||
free(data);
|
free(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
if (ts->LOOPS > 0) {
|
if (ts->LOOPS > 0) {
|
||||||
ts->LOOPS--;
|
ts->LOOPS--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue