* Fast code for scanning text enclosed in braces. Functionally * equivalent to this sscanf call: * * sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0 */
| 52 | * sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0 |
| 53 | */ |
| 54 | static int scanbraces(const char* in) { |
| 55 | if (strncmp(in, "{\\an", 4) != 0) { |
| 56 | return 0; |
| 57 | } |
| 58 | if (!av_isdigit(in[4])) { |
| 59 | return 0; |
| 60 | } |
| 61 | if (in[5] != '}') { |
| 62 | return 0; |
| 63 | } |
| 64 | return 1; |
| 65 | } |
| 66 | |
| 67 | /* skip all {\xxx} substrings except for {\an%d} |
| 68 | and all microdvd like styles such as {Y:xxx} */ |
no test coverage detected