36 const char *ptr = p->
buf;
39 while (ptr < ptr_end) {
42 if (!memcmp(ptr,
"FORMAT=TIME", 11) ||
43 sscanf(ptr,
"FORMAT=%d", &n) == 1)
45 ptr += strcspn(ptr,
"\n") + 1;
57 float multiplier = 100.0;
58 float current_pts = 0;
70 line[strcspn(line,
"\r\n")] = 0;
72 if (sscanf(line,
"FORMAT=%d", &fps) == 1 && fps > 3 && fps < 100) {
76 }
else if (sscanf(line,
"%f %f", &start, &duration) == 2) {
87 sub->
pts = (int64_t)(current_pts + start*multiplier);
88 sub->
duration = (int)(duration * multiplier);
89 current_pts += (start +
duration) * multiplier;
116 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
120 min_ts, ts, max_ts, flags);