MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / scanbraces

Function scanbraces

libavcodec/htmlsubtitles.c:54–65  ·  view source on GitHub ↗

* Fast code for scanning text enclosed in braces. Functionally * equivalent to this sscanf call: * * sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0 */

Source from the content-addressed store, hash-verified

52 * sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0
53 */
54static 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} */

Callers 1

handle_open_braceFunction · 0.85

Calls 1

av_isdigitFunction · 0.85

Tested by

no test coverage detected