Mercurial > libavformat.hg
comparison utils.c @ 9:97e61383cb81 libavformat
* Extend the syntax of a filename for the img reader to allow looping. Thus
%125*d means substitute the frame number MOD 125 into the filename. This
is a cheap method of having an infinite stream.
author | philipjsg |
---|---|
date | Wed, 11 Dec 2002 03:20:05 +0000 |
parents | 47e502ac6349 |
children | 932b59c66c60 |
comparison
equal
deleted
inserted
replaced
8:995bb04e02f1 | 9:97e61383cb81 |
---|---|
1087 for(;;) { | 1087 for(;;) { |
1088 c = *p++; | 1088 c = *p++; |
1089 if (c == '\0') | 1089 if (c == '\0') |
1090 break; | 1090 break; |
1091 if (c == '%') { | 1091 if (c == '%') { |
1092 nd = 0; | 1092 do { |
1093 while (*p >= '0' && *p <= '9') { | 1093 nd = 0; |
1094 nd = nd * 10 + *p++ - '0'; | 1094 while (isdigit(*p)) { |
1095 } | 1095 nd = nd * 10 + *p++ - '0'; |
1096 c = *p++; | 1096 } |
1097 c = *p++; | |
1098 if (c == '*' && nd > 0) { | |
1099 // The nd field is actually the modulus | |
1100 number = number % nd; | |
1101 c = *p++; | |
1102 nd = 0; | |
1103 } | |
1104 } while (isdigit(c)); | |
1105 | |
1097 switch(c) { | 1106 switch(c) { |
1098 case '%': | 1107 case '%': |
1099 goto addchar; | 1108 goto addchar; |
1100 case 'd': | 1109 case 'd': |
1101 if (percentd_found) | 1110 if (percentd_found) |