%125*d means substitute the frame number MOD 125 into the filename. This
is a cheap method of having an infinite stream.
Originally committed as revision 1332 to svn://svn.ffmpeg.org/ffmpeg/trunk
if (c == '\0')
break;
if (c == '%') {
- nd = 0;
- while (*p >= '0' && *p <= '9') {
- nd = nd * 10 + *p++ - '0';
- }
- c = *p++;
+ do {
+ nd = 0;
+ while (isdigit(*p)) {
+ nd = nd * 10 + *p++ - '0';
+ }
+ c = *p++;
+ if (c == '*' && nd > 0) {
+ // The nd field is actually the modulus
+ number = number % nd;
+ c = *p++;
+ nd = 0;
+ }
+ } while (isdigit(c));
+
switch(c) {
case '%':
goto addchar;