Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "avformat.h"
- #include "internal.h"
- #include "subtitles.h"
- typedef struct {
- FFDemuxSubtitlesQueue q;
- } STLContext;
- static int stl_probe(AVProbeData *p)
- {
- char buf[64], *pbuf;
- FFTextReader tr;
- ff_text_init_buf(&tr, p->buf, p->buf_size);
- /*Moving to next line in case of a command or new line or carriage return */
- while (ff_text_peek_r8(&tr) == '\r' || ff_text_peek_r8(&tr) == '\n' || ff_text_peek_r8(&tr) == '$')
- ff_text_r8(&tr);
- /* Checking if the next line matches a STL timestamp */
- if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
- return 0;
- if (sscanf(buf, "%*d:%*2d:%*2d:%*2d , %*d:%*2d:%*2d%*2d ,", &v) == 1)
- return AVPROBE_SCORE_MAX;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement